• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 598
  • Last Modified:

QTP script to get domain

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
noam_dz
Asked:
noam_dz
  • 4
  • 4
1 Solution
 
hiteshgupta1Commented:
see if this helps

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

Thanks
Hitesh
0
 
hiteshgupta1Commented:
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
 
noam_dzAuthor Commented:
I'm letting you know.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
noam_dzAuthor Commented:
Shouldn't it be RO instead of TO in Get__Property  
0
 
hiteshgupta1Commented:
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
 
noam_dzAuthor Commented:
DID YOU RECORD IT ON ONE PAGE AND TEST IN ON ANOTHER?

Anyway, how do I extract the domain name ?
0
 
hiteshgupta1Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now