Solved

QTP script to get domain

Posted on 2006-07-23
9
528 Views
Last Modified: 2008-02-01
I need a QTP script to get domain of a page i.e. get the URL and then extract the domain from the URL.
0
Comment
Question by:noam_dz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 8

Expert Comment

by:hiteshgupta1
ID: 17200225
see if this helps

 Browser("YOUR_BROWSER").Page("UR_PAGE").GetTOProperty ("url")

Thanks
Hitesh
0
 
LVL 8

Expert Comment

by:hiteshgupta1
ID: 17200228
this will just give u the URL of the web page
if u haev any problem in extracting domain name then kindly let me know

Thanks
Hitesh
0
 
LVL 4

Author Comment

by:noam_dz
ID: 17200253
I'm letting you know.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:noam_dz
ID: 17200260
Shouldn't it be RO instead of TO in Get__Property  
0
 
LVL 8

Expert Comment

by:hiteshgupta1
ID: 17213155
hi noam,
Sorry for being late in reply!

it is "GetTOProperty ("url")"
I have tested it here and it displays the URL correctly

Thanks
Hitesh
0
 
LVL 4

Author Comment

by:noam_dz
ID: 17213441
DID YOU RECORD IT ON ONE PAGE AND TEST IN ON ANOTHER?

Anyway, how do I extract the domain name ?
0
 
LVL 8

Accepted Solution

by:
hiteshgupta1 earned 500 total points
ID: 17213957
Hi Noam

For Extracting Domain name u need to perform string manipulation operation on the URL fetched
That's it

n yeah i haven't tried it on other pages
will try it and let u know the consequences

Thanks
Hitesh
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question