Micro Focus QTP (UFT) Forums
Using IF condition to check current page - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Using IF condition to check current page (/Thread-Using-IF-condition-to-check-current-page)



Using IF condition to check current page - janriis - 08-06-2008

Hi all

Im testing a web based application, where the user logs in and follows a flow. If the user has already done that flow, a different page is shown with a text "You have already done this flow, click ok to view details"

In my script i want to insert some sort of call to function, where a click on OK on the new page is performed and the script should not run any further from here. How do approach this ?


RE: Using IF condition to check current page - stevol - 08-06-2008

you should put in a variable that phrase using GetROProperty, then with IF condition on this variable you can skip the usual flow


RE: Using IF condition to check current page - janriis - 08-06-2008

Could you give an example of this, given the following information:

if First login: Page shown is welcome.htm, pagetitle: welcome to the flow
if Second login: Page shown is already_done.htm, pagetitle: already done the flow


RE: Using IF condition to check current page - stevol - 08-06-2008

Code:
dim a
a=Browser("xyz").Page("xyz").GetROProperty("title")

If a="Http://already_done.htm" Then
   ....
Else
   ....
End If



RE: Using IF condition to check current page - janriis - 08-06-2008

Thx m8, I'll see if i can get it working