Watir Webdriver And Extjs Finding Element
Solution 1:
ExtJS pages are hard to test, especially on finding elements.
Here are some of the tips I consider useful:
- Don't ever use dynamically generated IDs. like
(:id, 'ext-gen1302')
Don't ever use absolute/meaningless XPath, like
//div[4]/div[3]/div[4]/div/div/div/span[2]/span
Take advantage of meaningful auto-generated partial ids and class names.
For example, this ExtJS grid example:
(:css, '.x-grid-view .x-grid-table')
would be handy. If there are multiple of grids, try index them or locate the identifiable ancestor, like(:css, '#something-meaningful .x-grid-view .x-grid-table')
.Create meaningful class names in the source code. ExtJS provides
cls
andtdCls
for custom class names, so you can addcls:'testing-cmb-category'
in your source code, and get it by(:css, '.x-panel .testing-cmb-category')
.
Other answers I made on this topic:
Post a Comment for "Watir Webdriver And Extjs Finding Element"