Posts: 4
Threads: 1
Joined: Sep 2009
Reputation:
0
10-03-2009, 01:38 AM
According to the QTP Help text, there's a function called Browser("BrowserName").Back that's supposed to take you to the previous web page. When I try using it, though, I get a General Run Error message (which is not overly helpful). What I'm trying to do is this...
1. From the main page, click on a link to navigate to a sub-page.
2. Retrieve some information off of the sub-page.
3. Return to the main page, and click on another link to navigate to a second sub-page.
4. Retrieve some additional information off of the second sub-page.
5. Return to the main page and log out.
Clicking on "forward" links to the individual sub-pages from the main page is no problem. How do I back up to the main page, though, without starting from scratch and logging into it again? Unfortunately, there's no navigation link that will take me back there, other than the browser's Back button. I tried adding it into the repository, but it just comes back as a WinToolbar class called ToolbarWindow32.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
10-04-2009, 10:48 AM
General Run Error's are a pain in the neck. You never know why they pop up but as they state general they dont come with a explanation. Well here is my question,
1. Which version of QTP & IE do you use ?
Secondly, if you are familiar with "On Error resume Next" you can use this to capture the error number and then lookup on google to find the reason.
For Eg :
Code:
' At the start of your code write this,
On Error Resume Next
' your code block here...
...
...
Browser("BrowserName").Back
msgbox Err.Number
If Err.Number <> 0 Then
msgbox Err.Description
End If
Let me know if this helps you.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
10-06-2009, 10:24 AM
the error number -2147467259 usually appears when there is no more pages to go back at the browser.
Check the back button at your browser it must be disabled that means there is no any pages has been opened earlier.
open any url first and then open your url in the same browser and now try with code, it must be working.
if back does not work in this case, preferably use Browser.Navaigate
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
10-06-2009, 12:48 PM
'deminiek' -
There are some Known Browser issues between QTP 9.2 and IE7, For eg : Right click context menu wouldnt work on IE7, .Sync generates error sometimes and doesnt.
I suggest you contact HP support and find out if they have a patch or the reason for the error because Browser().back is a documented feature which at any cost with the defined functionality should work and no alternative/workaround is required.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
10-06-2009, 01:42 PM
may be I am wrong Basanth, but I doubt on your point, lets see first how it works with OP.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
10-06-2009, 02:18 PM
What is OP Saket ?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
10-06-2009, 02:43 PM
Aaaah...Intresting
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.