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
-
1Why are they using field id as selector? They should use field label as selector in their xpath.javanoob– javanoob2017-01-06 20:07:46 +00:00Commented Jan 6, 2017 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– Keith C2017-01-07 10:54:55 +00:00Commented Jan 7, 2017 at 10:54
Add a comment
|
2 Answers
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"]