Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL to capture
#1
Not Solved
hi,
I open a website, then the URL changes... i want to capture this new URL (in a variable, in a cell...) but i don't know how. It's possible?
[the aim of the test is to confront a long list of websites, so i must do a cycle... but before i must be able to capture these URLs...]

thx,
ste
Reply
#2
Not Solved
Try using GetROProperty("url")
Reply
#3
Not Solved
mmhhh... i have other problems before the use of your tip. I took a piece of code from another post, and i would want to apply your tip in it:

Code:
dim a
a="https://www.google.it"

SET IEObj = CreateObject("InternetExplorer.Application")
IEObj.Navigate a
IEObj.Visible = True
wait(2)  'suppose that in this time the url changes
Dim x
x=???
SET IEObj = Nothing


Which is the exact syntax to use GetROProperty("url") here to valorize x with the changed url?
I obtain syntax error about object repository...
[my problem is not to know the theory about these properties and their use... if you have some link to suggest me... :-) ]

thx for the patience :-)
ste
Reply
#4
Not Solved
Hi,
i'm a beginner in QTP and VBScript.
i would like to get the url af the current page.


I tryed to print the url on a message box like following:
Code:
MsgBox Browser("Browser").GetROProperty("url")

In return, i have a emplty messagebox. That means the url was not captured.

I tried also MsgBox Browser("Browser").GetROProperty("openURL"). But this line gives the first opened URL.

do anyone can advice on this subject?

Thank you in advance.
Reply
#5
Not Solved
Dear sidartha,stevol
Can you post your QTP script what you are doing so that i cna help you in that.

Regards
Sridhar
Reply
#6
Not Solved
Dear Sridhar,

My needs are following:
According to the URL, the password will change.
I have one identification scenario and some other scenarios where i need to confirm the password.

So i thought, in each scenario i need to confirm the password, i will capture the URL of the current page, do a IF statement and assign the value to the corresponding element.

Here is what i have tested:

Code:
Dim Env
Env = InputBox("Make your choice (INT, REC, PREX)")
If Env ="INT" Then
    Environment ("URL_ENV") = "http://www.google.com"
ElseIF  Env ="REC" Then
    Environment ("URL_ENV") = "http://www.yahoo.com"
ElseIF  Env ="PREX" Then
    Environment ("URL_ENV") = "http://www.msn.com"
Else
    Environment ("URL_ENV") = "http://www.homepage.com"
End If
Browser("Browser").Navigate (Environment ("URL_ENV"))
MsgBox Browser("Browser").GetROProperty("URL")


Do you have any other suggession?

Thank you for your help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with URL as Object identifier??? jcraig26 1 3,395 02-27-2013, 05:06 PM
Last Post: anil2u
  url value sia sharma 0 2,244 07-02-2012, 12:30 PM
Last Post: sia sharma
  split the values in url ....................... rjkmr.aiht 3 4,510 05-21-2012, 06:09 PM
Last Post: Ankesh
  Invalid URL Error manavkbgupta 2 2,841 03-28-2012, 02:15 PM
Last Post: manavkbgupta
  The browser Application can't be launched. Possibly the URL is wrong.- Win.XP-IE 8. fonsecba 2 6,541 05-26-2011, 04:06 PM
Last Post: manmeet.singh81

Forum Jump:


Users browsing this thread: 1 Guest(s)