Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Open a URL. through QTP
#1
Solved: 11 Years, 4 Months ago Question 
Hello All,

i am newbie to qtp ...

Can anyone give me a clue how to proceed on the below requirement...

when i try to run QTP...
it should prompt me a textbox(eg:- enter the URL you would like to open).
based on the text(eg:- URL name) which we enter into a text box... that particular website should open...


Thanks in advance
Navya
Reply
#2
Solved: 11 Years, 4 Months ago
Hi Navya,
This is the code you asked for

systemutil.Run inputbox("")

But usually we donot use like this in real environement..

This is the following code in the real environement

systemutil.Run "www.mail.yahoo.com","","",3

now what you have to do is highlight systemutil and press f1 then learn about that object.

Hope that is going to help you...

Regards
Sridhar
Reply
#3
Solved: 11 Years, 4 Months ago
Hello Sridhar,

thank you very much for the response.
i tried the option of systemutil.Run inputbox("")
it worked out for me...

but as you said it will not be used in realtime...
and also you have suggested to use the below one...
Code:
systemutil.Run "www.mail.yahoo.com","","",3

i have question on the above statement...

if i have 3 sets of urls like www.google.com or www.yahoo.com or www.monster.com...

and every time i ran the script i may be using any one among the 3 above urls then in that case is there any way to read the url and pass that url into a variable and then pass this variable as a parameter to the systemutil.run statement ???

like i followed the below steps...

Code:
sName = InputBox("Enter Url")
systemutil.Run " &sName "","","",3


i am getting Run Error saying : "invalid procedure call or argument"

i might be doing wrong.... please correct me...


Thanks
Navya
Reply
#4
Solved: 11 Years, 4 Months ago
please check your syntax you have used more than one " in systemutil.run line..Hope this was the only problem..:-)
Reply
#5
Solved: 11 Years, 4 Months ago
this time i tried using the below format ....

Code:
sName = InputBox("Enter Url")
systemutil.Run  ""& sName,"","",open,3

it worked out successfully for me.

Thanks for all suggestions...

thanks
Navya
Reply
#6
Solved: 11 Years, 4 Months ago
Or you can use a Procedure:
Example:

Code:
StrURL = InputBox("Enter the URL")
Call InvokeIE(StrURL)

Function InvokeIE(URL)
       SET IEObj = CreateObject("InternetExplorer.Application")
       IEObj.Navigate URL
       IEObj.Visible = True
       SET IEObj = Nothing
End Function
Reply
#7
Solved: 11 Years, 4 Months ago
Hi niranjan
Thanks for the another solution...
Reply
#8
Solved: 11 Years, 4 Months ago
Hi,
In the above script I have given the URL as www.gmail.com, for closing the browser I used
Browser("Browser").close after call Invoke function
but it saying object not found
Which command I need to use to close it?

Thanks,
Akhila
Reply
#9
Solved: 11 Years, 4 Months ago
Instead of Browser("Browser").Close, try using Browser("name:=.*").Close
Reply
#10
Solved: 11 Years, 4 Months ago
Sorry I have some silly doubts about it
1) In the above script what does "name" refers to ? Is it the name of the browser... like Gmail
2) Just for closing the browser why I need to use "name:=.*"? Can you suggest some material to learn such functionalities
3) When I modified the script as you suggested I got the following error "Cannot identify the object "[ Browser ]" (of class Browser). Verify that this object's properties match an object currently displayed in your application."

Thanks,
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP does not record the first step of open filight reservation application. Blossoms 9 17,761 07-20-2015, 05:50 PM
Last Post: AJAJ
  When QTP is open am not able to open my AUT. chetan3987 2 3,108 02-12-2014, 01:18 AM
Last Post: supputuri
  How to enter values into excel which is already open using QTP Narayanan 1 4,400 12-11-2013, 07:30 AM
Last Post: basanth27
  Problems with URL as Object identifier??? jcraig26 1 3,363 02-27-2013, 05:06 PM
Last Post: anil2u
  cannot open QTP tests learnasugo 8 9,280 10-18-2012, 11:28 AM
Last Post: Ankesh

Forum Jump:


Users browsing this thread: 2 Guest(s)