1
votes

I have questions on automating the test cases of an ExtJS application using the Selenium webdriver.

Two years back, I was asked to automate the same ExtJS application using HP UFT. I did that by developing a custom UFT add-in for the ExtJS components. Now I am asked to continue the automation but with selenium webdriver and not UFT. Today, I tried with a few controls and I see that Selenium fails to recognize a few controls like ExtJS tree node, ExtJS tab etc using the xpath.

I see firepath takes me to the correct control when I type the locator value in it. But if I use the same locator value in my Java code, I get a nosuchelement exception thrown by Selenium.

Here is my code to select a particular node in the list.

<div>
    <span class="x-tree-node-text">Circuit</span>
</div>

By.xpath("//span[contains(text(),'Circuit')])[1]")   // there are two circuits like

Is my job of automating using Selenium going to be tough? I learnt only Java. Should I learn new technologies to automate this app?

Please let me know.

1

1 Answers

1
votes

ExtJS is an animal when it comes to automating with Selenium. I've done several ExtJS apps with nothing more than CSS and jquery selectors. Jasmine is the recommended approach but I haven't investigated it as I haven't found the need. If you include the sizzle library it will allow you to use jquery selectors which are very helpful. To select the element you provided with jquery it would be:

$("span.x-tree-node-text:contains('Circuit')")

I'm on my phone and can't provide links but look into adding sizzle to your framework. It will greatly improve your success automating ExtJS.

Your provided selector isn't working because you are specifying id for a div/span with no id.

I also ran into timing issues with ExtJS, where Selenium wasn't waiting for the dom to finish loading before it would blowup. The solution was to add a wait for ExpectedConditions.visibilityofElementLocated.