Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

QTP script to get domain

Posted on 2006-07-23
9
Medium Priority
?
537 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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 2000 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

715 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