You need to sign in to do that
Don't have an account?

Selenium automation on lightning
We are trying to automate regression testing using Selenium web driver. Issue we are facing is that element Ids are getting randomly generated and Selenium is not able to identify elements.
We have tried putting unique Ids using aura:id for such elements but still these Ids are not coming up in console.
Classes are getting generated randomly.
XPATH is also not working.
We have tried putting unique Ids using aura:id for such elements but still these Ids are not coming up in console.
Classes are getting generated randomly.
XPATH is also not working.
The aura:id and element Id will not help you here. Relative xPath may also not work.
Try to use Absolute Xpath (traversing down from HTML element), which will definetelywork here or any other situation.
Use this plugin to get absolute xPath http://toolsqa.com/selenium-webdriver/xpath-helper/
Let me know if you need more help on this.
Thanks,
Manish
We tried using this plugin but in our case, it seems absolute XPATH is not getting generated correctly.
We followed these steps:
1. Downloaded the helper and installed on Chrome.
2. We launched the application and helper.
3. Generarted Absolute XPATH by holiding SHIFT key and pointing to the element.
4. Result window is blank.
I have attahced the screenshot as well.
Can you please add the absoulute XPATH here which is being generated by tool? If the tool is not working properly, please try to create the absolute xpath manually for 1 component and try to see if selenium is working properly.
the absolute XPATH for span should look like below:
//HTML/BODY[1]/DIV[3]/SPAN[1]
In similar way try to generate the xpath for your element manually and test with selenium if the element is being handled properly or not.
Let me know for further question on this.
Thanks,
Manish
For us code is not simple. Attached is the code. We are trying to capture element at line 108 (last line: <span id="{!'AddText'+index}">)
Did you get soultion for above prblem? I am facing same issue my Objects are not getting recognize by any locators
I am trying to find x-path for Account Name field when clicked on New button on Account homepage as in below screenshot:
//div/label/span[text()='Account Name']/../following::input[1]
Able to enter text into Account name field now.