Reputation: 417
I have an element in a window in a web page, which I am able to identify for the first time, and able to automate a test case, successfully. But, during second time, after saving, the element's div gets updated like div(name), gets changed to div(name[1])...
How can I identify this element, successfully all times? I want to click on an element which is nearby the div(name) each time, and there are no other unique identifiers for the page.
I am using a selenium for test automation. The site that I'm tested is built with ext-js.
Upvotes: 0
Views: 408
Reputation: 2615
When you mentioned Selenium-like framework, what exactly you meant? Ext JS is a trickier thing to automate. I would suggest using Sahi Pro for automating ext js applications.
Let me put the reasons:
Sahi will not depend only upon the ID of the elements you are identifying. So even if the id changes, it can recognize it using its relative position in the window. So if your div is near some heading:
You can identify the div as _div(0, _near(_heading3("This is a div")));.
There are other accesors available to recognize the elements robustly. You can also use other information such as class, label, text etc to recognize the elements.
Hope that helps. Thanks, Vivek
Upvotes: 1
Reputation: 417
The element, gets updated in the Main Grid Layout, and next time, the element which I am identifying becomes, item[1], from item...So, I have no other choice but to make the element unique, for which, I removed the item from Main Grid Layout, where its getting auto updated...This solved, my problem...From next time, the element was consistently identified, by the automation tool...
Upvotes: 0