Micro Focus QTP (UFT) Forums
‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP - 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: ‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP (/Thread-%E2%80%98General-Run-Error%E2%80%99-when-trying-to-fetch-URL-in-Browser-Address-Bar-with-DP)



‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP - sukhvinderh - 10-07-2011

Below is the code snippet:

Code:
strBrowserTitle = Browser(“Index:=0″).GetROProperty(“title”)
strPageTitle = Browser(“Index:=0″).Page(“Index:=0″).GetROProperty(“title”)

strNewURL = Browser(“title:=”&strBrowserTitle&”").Page”title:=”&strPageTitle&”").GetROProperty(“url”)

This last line of code gives this error. Also tried the below variation but again getting the same error:

Code:
strNewURL = Browser(“title:=”&strBrowserTitle&”").Page”title:=”&strPageTitle&”").Object.URL

This code used to function properly before but all a of a sudden it started giving "General Run Error".


RE: ‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP - guin.anirban - 10-08-2011

Could you please double check your script?


RE: ‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP - sukhvinderh - 10-10-2011

What do you mean ? Did you find any flaw in the script ?


RE: ‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP - guin.anirban - 10-11-2011

Does browser support 'index' property?. Not sure..'Creation Time' is there...


RE: ‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP - vnsk - 10-13-2011

Try
Browser("title:= about:blank").Navigate "url"

URL= give the required url there and make the home page to blankmin internet options before running the script


RE: ‘General Run Error’ when trying to fetch URL in Browser Address Bar with DP - v.swaminathan - 10-14-2011

Hi.. It looks like the brackets (in page) and the double quotes are not correct in your line of code..

Actual:
Code:
strNewURL = Browser(“title:=”&strBrowserTitle&”").Page”title:=”&strPageTitle&”").GetROProperty(“url”)

Expected:
Code:
strNewURL = Browser("title:="& strBrowserTitle).Page("title:="& strPageTitle).GetROProperty("url")

Please try with the above(Expected) one...
Ensure that the values you pass for the strBrowserTitle and strPageTitle are also correct.
Incase you are not sure, then try the below one (but ensure that u have opened only one IE browser at the time of execution)..
Code:
strNewURL = Browser("name:=.*").Page("title:=.*").GetROProperty("url")