I have two elements on my page (two ‘cancel’ elements).
<div unselectable="on" class="x-grid-cell-inner x-unselectable" style="text-align: left; " id="ext-gen1179">
Cancel
</div>
<div unselectable="on" class="x-grid-cell-inner x-unselectable" style="text-align: left; " id="ext-gen2951">
Cancel
</div>
How do I click on the second element? Obviously, I can’t us id because it is randomly generated on each visit. What can I use?
1. Use FindElements method, which finds all IWebElements within the current context using the given mechanism. (In this case, you always need to know the index of the element you are looking for.)
2. If those cancel buttons are in different sections, which can be identified by non-ExtJS id attributes.
3. If those cancel buttons are in different sections, which can be identified by different ExtJS class attributes. (use the meaningful ones)