

Ask HN: Any Javascript Framework specific Selenium Version? - digamber_kamat

I am developing a site which is completely written in Extjs Framework. Which means 0 lines of static HTML code. All the Ids, classes etc are assigned during run time. I am not sure how to use selenium in such situations. Can some one help me out?
======
waynep
You have complete control over which classes are assigned to what nodes.

For example if you create an alert box with ExtJS you can always add a no-op
classname to it. This way you can write your Selenium test to do class based
look ups and then verify the contents of the child nodes within.

~~~
digamber_kamat
This sounds the most promising one. But say I have an Extjs COmboBox and I
want to select a particular item in it. It becomes too difficult to do it your
way. I have to use the Selenium.Eval function and write some javascript in it.

------
hugs
If all the ids and classes are assigned during run-time, you're kinda SOL.
Though Selenium does support other locator strategies like XPath, and even
plain old JavaScript expressions to find an element. I would ask the the ExtJS
folks how they would expect someone to test their app from a GUI perspective.
You need some kind of reliable handle to find an element on the page so you
can act on it.

------
mullr
The only advice I can offer is to keep as much code gui-agnostic as possible.
The usual advice, really, just applied to javascript. Then you can use
something like <http://jsunity.com/> to test most of it. Gui testing is
inevitably harder anyway, even if there are tools.

~~~
hugs
"Gui testing is inevitably harder anyway, even if there are tools"

I agree. The Selenium project could really use some volunteers to look at the
major JS frameworks out there and help make them more testable with Selenium
(or WebDriver, which Selenium is merging with in Se 2.0).

------
soundadvice
[http://extjs.com/blog/2008/11/03/testing-ext-js-ext-gwt-
appl...](http://extjs.com/blog/2008/11/03/testing-ext-js-ext-gwt-applications-
with-selenium/)

Might be a good start.

~~~
digamber_kamat
yes that helped a good deal, but not solved the problem completely.

------
mahmud
Oh boy. Someone found a hammer and quickly ran out of thumbs.

 _I am developing a site_

Everything that followed that utterance was a bad idea. At that point, you're
not using javascript for the portability, light weight OR "scripting". You
should have used any "applet" RIA technology out there and you would have been
fine; java, flash, silverlight.

~~~
zcrar70
Neither Flash, Java or Silverlight will work with Selenium either. In fact,
it's pretty hard to get any form of automated acceptance testing working with
any of the RIA technologies.

