Handling ExtJS Messageboxes and Dialogboxes (195 Views)
Reply
Advisor
adityasrinivasb
Posts: 55
Registered: ‎01-19-2011
Message 1 of 2 (195 Views)

Handling ExtJS Messageboxes and Dialogboxes

Hi

I am writing functional test scripts for an extjs application. The developers in my team built a QTP custom add-in for extjs. I was the one who gave them the requirements like what extjs components I need in the add-in and their properties and methods. In the add-in, they gave me two components called as ExtDialogBox for extjs dialog boxes and ExtMessageBox for the ExtJS message boxes. The dialog box in my application is like a form that pops up. Ex : Login form . The class of this dialog box in the DOM tree is x-panel. Similarly a extjs message is like Yes or no confirmation message that pops up in my application. Its class in the DOM tree is x-window.

I am not sure whether I gave the correct requirement to the developers for MessageBox and Dialogbox.
My confusion is with the script I am writing and especially the hierarchy in the script.
For Ex:  If I want to click a button in the login dialog. Should the script be

1) Browser("App").Page("App").ExtButton("Login").click
or
2) Browser("App").Page("App").ExtDialogBox("loginform").ExtButton("Login").click

When I record Login click, QTP inserts statement 1 above. But I can click the login button using statement 2 as well.

How should the hierarchy of the objects be in this case. Is statement 2 above valid in QTP? How should these pop ups be handled by QTP in general?

Regards
Srinivas

HP Expert
Eickel
Posts: 147
Registered: ‎04-13-2012
Message 2 of 2 (167 Views)

Re: Handling ExtJS Messageboxes and Dialogboxes

Hi Srinivas,

Thank you for your reply.

 

There isn't like an unique official structure to be followed all the times to build the test steps hierarchy. I'd say it has to be more with the minimum required properties (and hierarchy information) needed to identify the object uniquely.

 

For example, you will see an hierarchy when you do object spy on an object but not the same (most of the times) is used in the steps hierarchy or in object repository.

So, my recommendation is to do recording of the step in the application (or manually using the object spy to add it and then drag and drop from the repository) and from the generated step, you will know which would be a good structure for it.

I hope the above helps.

"HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution."
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.