Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I check for the URL in QTP.

Status
Not open for further replies.

NewbeeQTP

Technical User
Oct 15, 2006
1
US
Hello Everyone,
I'm new to this forum and I don't know if I'm asking this question on the right place but any suggestions and tips would be of great help for me.
I'm new to QTP and trying to learn it by testing a web application. I'm trying to automate a page (Logon page) and based on a valid userid the logon button redirects me to a new page (New URL) if the user is invalid it keeps me on the same page with an error message. Now if I've to check and see if the URL has changed (or is the URL of the new page) how do I do that using QTP or is there any other way of doing it in QTP.

Thanks for you time and suggestion in advance.

--
 
I am sure a new page will have several objects that are different from the Logon page. Find a unique object on the page after logon and do an exist statement. If you find that object on the next page then you proceed further, else if you are still on the logon page(not a valid userid) throw error.

If you want to do the URL way, grab the URL store it in a variable and grab the new URL store in it in another variable and do an instr or strcmp functions on both the variables.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top