Solved

QTP script to get domain

Posted on 2006-07-23
9
492 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
  • 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
 
LVL 4

Author Comment

by:noam_dz
ID: 17200260
Shouldn't it be RO instead of TO in Get__Property  
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 4

Author Comment

by:noam_dz
ID: 17213683
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 70
array11 challenge 16 59
WMI, model #, retrieving information 10 112
Export Table to CSV - Access to CSV - using python 18 96
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now