Tips for locating elements in Ext JS applications with Selenium WebDriver
Locating elements in web applications created by Ext JS framework could be a total nightmare for UI automators, as Ext JS generates one of the most complex DOM structures which have dynamic IDs with a large amount of duplicate class names. Unlike automating applications with simple DOM structures, Selenium WebDriver's built-in methods like By.Id , By.ClassName , By.Name would barely identify anything in Ext JS applications. In most of the cases, By.CssSelector or By.XPath will be neccessary, even though using them are not that straightforward either. Hopefully this article would help developers write the most concise meaningful and human readable locators, so that maintenance cost can be kept minimum when automating ExtJS applications. Ext JS Example DON'Ts Don't match only IDs Don't use highly position-dependent XPaths Don't match single class name only Don't perform exact match on multiple classes Don't use too...