2

I learning automation of application with selenium ide.The application which I am currently testing is a extjs application.In this application all the required validations are shown in the tooltip.For ex: I have password form in which new password and confirm password are the two fields and there is a submit button.If the password entered in the new and confirm password field do not match then "Password do not match" message is shown in the tooltip and the submit button is disabled.In this case how to verify the tooltip and its contents in the selenium. Plz can anyone suggest some solution to the above problem?All validation in my application are shown in the tooltip.

thanks, sushi

Ates Goral
  • 126,894
  • 24
  • 129
  • 188
sushi
  • 21
  • 2

1 Answers1

0

First, make sure that you explicitly assign ids to your fields. Otherwise, it will be very hard to get a hold of the components with the automatically generated ids (like "ext-comp-004").

The strategy is to use the verifyEval Selenium command and use the Ext JS API to do certain things.

For checking the active error message of a field with id "password_confirm", you can use:

Ext.getCmp("password_confirm").getActiveError();

First, try this in the Firebug console manually to make sure it works for you. Then you can do the same in your Selenium script as:

  • Command: verifyEval
  • Script: Ext.getCmp("password_confirm").getActiveError()
  • Expected: Passwords do not match

If you want to test this out with Selenium IDE in Firefox first, you should take into account that the window object will be wrapped in a XPCNativeWrapper. You can access the actual window object and the Ext JS namespace in it through wrappedJSObject:

  • Command: verifyEval
  • Script: window.wrappedJSObject.Ext.getCmp("password_confirm").getActiveError()
  • Expected: Passwords do not match

For some general tips on testing Ext JS applications with Selenium, see this answer. Some parts of it may be outdated, but can still give you an idea about the general strategies involved.

Community
  • 1
  • 1
Ates Goral
  • 126,894
  • 24
  • 129
  • 188
  • Thanks a lot for your help..It really worked for me, as you said it works for the static id's.As I am a QA I cant make the id's static.So i'm facing difficulty because of the generated id in the extjs. – sushi Feb 11 '11 at 10:19