Service Virtualization

Expand all | Collapse all

What is the best practice to manage selenium steps if i need to update locator type and value fields often?

Jump to Best Answer
  • 1.  What is the best practice to manage selenium steps if i need to update locator type and value fields often?

    Posted 09-21-2017 02:11 PM

    I have many selenium steps in my devtest selenium integrated test cases.

    The application that i am testing will be upgraded atleast once every 6 months, when the upgrade happens, their html elements such as id, name, etc are prone to be changed or updated.

    So i am trying to know if there is a best way to manage your test case steps so that i will not have to go individually into each step and change the id or name.

     

    The idea that i have in my mind is to create properties for type and value in a selenium step for instance a type can be "xpath" and value could be "an xpath for the element" in the project config, in that way i will have to edit, just the property file once with new id's or names for those elements.

    But then the project config file will have lot of properties and little complicated to look.

     

    Are there any ways to help this scenario, what are some of the best practices if you can suggest.

     

     

    Thank you.



  • 2.  Re: What is the best practice to manage selenium steps if i need to update locator type and value fields often?
    Best Answer

    Posted 09-21-2017 05:33 PM

    Not sure what version of DevTest you are on, but you can refer to this link:

     

    Edit Selenium Test Steps Within CA Application Test - DevTest Solutions - 10.1 - CA Technologies Documentation 

     

    You are right about the config file getting kind of complicated to look at but that is where you would have to get creative with your naming so you could group your keys in sections where is would be easier to update.

     

    Hope this helps.



  • 3.  Re: What is the best practice to manage selenium steps if i need to update locator type and value fields often?

    Posted 09-23-2017 05:33 PM

       Thanks for the response Marcy.

      I installed the CA application test plugin in seleniumbuilder based on the instructions above, i was able to see screenshots and an xpath locator there, but what i really need is the feature to select a different target for an element on the page. It is easier in selenium builder to try alternatives. Do we have anything similar in DevTest or is it intended to be added in future?

    Looking at xpath locator, i am not sure how to use it as i wasn't getting any information except the tree structure, i assumed  that the element names in the web page are recorded.

    Is there any tutorial on how to use the xpath locator.



  • 4.  Re: What is the best practice to manage selenium steps if i need to update locator type and value fields often?

    Posted 09-25-2017 09:57 AM

    Hi, ebenezar.janga! There xpath editor can be useful. Be sure to select the correct object. I like to change the JSON in-line.

     

     

    You may find this webcast recording with demo and presentation useful: Webcast Recap: DevTest &  Selenium 

    Best,

    Dan



  • 5.  Re: What is the best practice to manage selenium steps if i need to update locator type and value fields often?

    Posted 05-10-2018 02:07 AM

    I think you should rely on code less testing tools like cloudqa as they provide easy maintenance. check this article to get more information