I am executing a script in Selenium IDE 1.5.0 in which I refresh a page and sort a table of data.
I need to reference an element of the table based on it’s position.
What I currently have:
clickAndWait css=input[type="image"]
click //a[contains(text(),'Yield')]
pause 999
click //a[contains(text(),'Yield')]
pause 9999
storeTable id=table-0.2.14 x
I’m getting the error:
“[error] Element id=table-0 not found”.
However, when I hit the “find” button on the storeTable command, the appropriate element in the table is found.
Searching for the answer I’ve found forums that suggest that a pause is needed, but the pause currently being used is plenty long.
I’ve also noticed that it will sometimes run successfully if I switch to an open Chrome browser and then back to the Firefox browser while it’s running. There’s obviously a reason why this is happening but I’m not understanding what’s happening.
I’ve tried playing with the focus() command (thinking that the active window is switching) but that doesn’t seem to be working either.
I was able to solve my issue by using xpath to reference the position in table:
For whatever reason using the id doesn’t seem to work.