harish_renu78
Member
Reged: 04/11/05
Posts: 34
Loc: Hyderabad
|
|
Recently our company has decided to use AJAX for presentation layer. I am curious to know whether QTP can test a web application whose UI is developed using AJAX technology. Currently we are using QTP 9.0.
Or we have to go for an add-in to support AJAX components.
Regards
-------------------- Harish,
Senior QA Engineer,
Virtusa India Pvt Ltd,
Hyd, India
|
Tarun Lalwani
Veteran
Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
|
|
I dont think QTP would be the best tool to test for AJAX apps but you certainly can use it for testing AJAX application
The below was not for an AJAX app but the issue was similar
http://www.sqaforums.com/showflat.php?Ca...&PHPSESSID=
-------------------- Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **
KnowledgeInbox RSS
|
Turbografx
Super Member
Reged: 10/21/05
Posts: 1756
Loc: London, U.K
|
|
Quote:
Or we have to go for an add-in to support AJAX components.
Regards
There are no 'AJAX components'. All you need is the web addin. I have been testing ajax sites for 2 years with no problems.
|
sanjeetjena
Newbie
Reged: 04/22/07
Posts: 7
Loc: pune
|
|
Post deleted by IanF
|
Turbografx
Super Member
Reged: 10/21/05
Posts: 1756
Loc: London, U.K
|
|
Here's a better idea. Why don't you tell us what problems you have faced and then we can look at some solutions for your problems.
|
sanjeetjena
Newbie
Reged: 04/22/07
Posts: 7
Loc: pune
|
|
Actually, i have to give a presentation on the possible issues that a person can face while testing ajax using qtp. Also, the ways of over coming those issues.
You wrote that you are testing ajax for more than 2 years, so thought of asking you.
Here is a situation,
As far as i know, one cann't use ".sync" function for AJAX. 'coz, when e we give some input, the page is suppose to be get loaded, in AJAX, the datatable or the area of the page where the data is expected get refreshed and not the entire page. So, one cann't use ".Sync". cann't use ".Wait" property as one cann't predict the time required for loading the data.
Can you please give me an idea to over come this problem.
Thanks Sanjeet
|
Turbografx
Super Member
Reged: 10/21/05
Posts: 1756
Loc: London, U.K
|
|
Well that's better than original post.
I can't comment on ".sync" because I never use it.
However, I think the question for AJAX applications would be does QTP continually search the DOM for objects. If it does, then what does it matter if content is dynamically loaded?
I think you need to download the trial version, test your application, then post any questions you have.
|
sanjeetjena
Newbie
Reged: 04/22/07
Posts: 7
Loc: pune
|
|
ok. Will do that.
But jus wanna know how will u design ur script for the situation where u have given some input n click on "Submit" sutton. Now,u expect a result table to get displayed in the web page.
how will u make the script wait till the result table get loaded n then verify the data?
Please let me know.
|
Turbografx
Super Member
Reged: 10/21/05
Posts: 1756
Loc: London, U.K
|
|
You would do it the same way as any other web application - object synchronization. Don't confuse this with browser synchronization.
|
wdragon007
Member
Reged: 04/21/05
Posts: 75
|
|
Okay, so I recently got assigned a project that uses AJAX widgets to dynamically load pages. I can deal with non-dynamic pages but this is my first experience with AJAX.
I threw together a basic script using the record function (which I planned to modify to eliminate the OR and go the DP route for easier management of the scripts) but for some reason QTP is not recognizing any of the dynamic web elements - even using the original descriptors in the OR. Basically, it recorded the inital 'walkthrough' but refused to replay the action.
When attempting to use the object spy on a dynamic object, the only thing returned are the Browser and Page objects. Is there a way to get the object spy to recognize the dynamically generated object or is there a setting that needs to be set to 'refresh' the script so that any new objects added to the page are detected?
Any help on this would be *greatly* appreciated and might help prevent future skull damage from me pounding my head into my desk.
|
Turbografx
Super Member
Reged: 10/21/05
Posts: 1756
Loc: London, U.K
|
|
Do you know which toolkit your application is using?
Object spy will usually display a WebElement, is this not the case?
Record and playback usually fails for these objects because mandatory/assistive properties are dynamic.
|
wdragon007
Member
Reged: 04/21/05
Posts: 75
|
|
Quote:
Do you know which toolkit your application is using?
Honestly, I have no idea. I'll see if I can get an answer from the developers.
Quote:
Object spy will usually display a WebElement, is this not the case?
That is correct. Mousing over on all of the dynamic elements only show browser and page objects. Clicking directly on one of the webelements only shows those two levels (B.P) as well. I've never seen this problem before but then this is the first project I've dealt with that used AJAX. So far, I'm not liking it.
|
baiju
Junior Member
Reged: 07/05/03
Posts: 4
Loc: Bangalore
|
|
Harish,
Can u help me start with database checkpoint .How to learn?
|
RajHaldar
Member
Reged: 10/04/06
Posts: 114
Loc: Boston, MA
|
|
Using QTP with AJAX applications sometimes gets very tricky. And yes the .Sync method doesn't work for most AJAX applications neither does the brower ready state or browser sync. You wont even be able to wait to see if the Dynamic object exists or not, because all the objects are loaded and using DP you'll end up getting those objects even if they are not visible on the application.
We used a DOM object which would change its state or contain a flag specifying when the page is fully loaded and available for interactions.. Same thing with dynamic tables and other elements. We had to request the dev team to add in these dom objects for us.
|
wdragon007
Member
Reged: 04/21/05
Posts: 75
|
|
Okay, so I'm curious to know if there is a way to 'trick' QTP into refreshing it's recognition of objects on a dynamically generated page. I tried Browser().Page().RefreshObject and that's still not working -- the scripts aren't recognizing the WebElements correctly.
For the most part, the only thing that the script is recognizing are the browser and page objects. The dynamic content is being listed as a WinObject. Ugh. I'm starting to think that automation isn't going to be an option here.
|
AnshooArora
Advanced Member
Reged: 10/27/07
Posts: 612
Loc: New Delhi, India
|
|
I have created a small utility for synchronization with AJAX applications which can be found here.
I hope it helps.
-------------------- Regards,
Anshoo Arora
[AdvancedQTP] [LinkedIn] [Relevant Codes]
|
AnshooArora
Advanced Member
Reged: 10/27/07
Posts: 612
Loc: New Delhi, India
|
|
Please disregard the URL above.
Updated URL: http://relevantcodes.com/qtp-synchronization-for-ajax-applications/
-------------------- Regards,
Anshoo Arora
[AdvancedQTP] [LinkedIn] [Relevant Codes]
|
RoiC
Member
Reged: 02/04/09
Posts: 29
|
|
I suggest you read the post on the HP blog below regarding this important topic:
http://www.communities.hp.com/online/blo...plications.aspx
-------------------- Any information given by me in this blog is done not as part of my formal job and on a personal level due to my interests.
My HP Blog "The Future of Testing": http://www.communities.hp.com/online/blogs/functionaltesting/default.aspx
|