Why is it difficult to Automate?
To interact with DOM elements, Selenium Commands should specify the target elements using their xpaths.
click //input[@value='Google Search' and @type='button']To determine the xpath we can use tools like xpath add-on for Firefox or record and get the xpath from Selenium IDE. But the biggest challenge here with ExtJS is this xpath changes every time page reloads as element IDs are randomly generated by default.
So the xpath generated using above mentioned ways will give some thing like
//div[@id='ext-gen77']/div/table/tbody/tr/td/divThis xpath will get changed every time you reload the page. So if you try to run the test it gives
[error] Element //div[@id='ext-gen77']/div/table/tbody/tr/td/div not found
How did I solve this?
To solve this Problem we need Firefox Browser with Firebug, Selenium IDE Add-On installed.
Record the Test Case using Selenium IDE
Open your Application UI which is developed in ExtJS. Right click on some element like Edit Button and say "Inspect Element"
Replace xpath which got recorded with