3

My testing team is using selenium to automate salesforce testing,in the process, they reference the Id's of text boxe's or drop down boxes in the automation script,this works well and good for standard fields as they are similar across different organizations but for custom fields this varies and hence they have to develop different script for each instance, any help on resolving this issue would help us .thanks

  • 1
    Why are they using field id as selector? They should use field label as selector in their xpath. – javanoob Jan 6 '17 at 20:07
  • My first reaction when using Selenium was the same as yours as using the ID values is a natural thing to want to do. But there is no API to get the custom field IDs and so you are forced to use an alternate pattern such as the one that javanoob suggests. – Keith C Jan 7 '17 at 10:54
1

I was facing the same problem. As it was suggested in the comments above using another attribute than id actually works. So try any other unique field in the selector:

xpath=//*[@aria-label="MyLabel"]

or

xpath=//*[@title="MyTitle"]
-1

Try to create your own XPath. eg: xpath : //*[@tagName= "Testing"]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.