PDA

View Full Version : Ext and Selenium test



Sunflower
5 Sep 2007, 12:43 AM
We're looking to implement automated test on our thin client (built around Ext :D).

Does anybody has an experience testing Ext applications, is there a better way ?

We're checking with Selenium and have some issues/questions :

- Is there an easy way to identify buttons,labels, inputs (id's are generated automatically by Ext and don't look easy to reset).

Using Selenium IDE we're getting :


public class NewTest extends SeleneseTestCase {
public void testNew() throws Exception {
selenium.open("/index.html");
selenium.click("ext-gen391"); // button
selenium.type("ext-comp-1055", "some test"); // input
}
}

Thanks in advance

J.C. Bize
10 Sep 2007, 4:43 PM
You can specify the id that will be generated for many of these controls.

For example:


myForm.add(
new Ext.form.TextField({
fieldLabel: 'First Name',
id: 'txtFirstName',
name: 'first',
width:175,
allowBlank:false
}));

would cause the text field to be created with a DOM id of "txtFirstName" rather than say, "ext-comp-1001".

I'm curious if anyone has come across any issues with creating an "automation friendly" extJS application and has any tips to share?

Cheers,
JC

kumar303
5 Dec 2007, 8:32 AM
our team is still struggling through getting Selenium to work with our Ext JS application. As for the above example, we have found that type_keys() works better for text boxes than type(). Might be typeKeys() in the java API.