Question T6124
Visible to All Users

Survey ID for Automation

created 5 years ago

Dear Survey Team ,
Instead of random div Id can we use custom login to add sequential id to the question with their name attach for the automation testing tool as it fail's for the div id's changes for the survey randomly.

Regards,

Comments (1)

    Please anyone help me out ?

    Answers approved by surveyjs Support

    created 5 years ago

    Hello,

    You can programmatically set the id property https://surveyjs.io/Documentation/Library?id=Question#id for every question and rely on these id values in your tests.

    Thanks, Serge
    SurveyJS Team

      Comments (2)

        Is there way ? I want to use an automation tool to run the survey

          Hello,
          Serge gave you a solution that you can use. You can create your own property as:

          JavaScript
          Survey.Serializer.addProperty("question", {name: "automationId", category: "Automation"});

          This property will show in your SurveyJS Creator and you can set it in Creator or you can set this property in JSON as any other property.

          Thank you,
          Andrew
          SurveyJS Team