Reputation: 99
I have to test an Extjs application. But the id is dynamic so there is no way to capture it. But developers have been adding another property as itemId to elements. Is there a method to capture that itemId using selenium?
Upvotes: 0
Views: 286
Reputation: 3629
You can execute JavaScript code on the page using Selenium to get the dynamic ID.
In this code you can use Ext.ComponentQuery
for getting exactly the ExtJS component you want. Next using function .getId()
you can get the dynamic ID.
driver.execute_script("Ext.ComponentQuery.query('#myPanel').getId()")
You can read more in my other A to the similar problem https://stackoverflow.com/a/41718879/1768843
Upvotes: 1