This is a migrated thread and some comments may be shown as answers.

URL verification?

3 Answers 387 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Graham
Top achievements
Rank 1
Graham asked on 19 May 2011, 09:34 PM
Is it possible to verify the URL of the current page?

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 19 May 2011, 09:43 PM
Hello Graham,

You have two options. Perhaps the easiest is to use the Wait For Url test step feature. You can set the properties for what form of URL you want to verify. The test will fail if the URL of the active browser does not match the specification you give it after the timeout period.

The other option is to use a coded step. You can get the current URL property via:
ActiveBrowser.Url

This returns a simple string for the current URL. Once you have the URL string, you can do sort of parsing and verification you want in code.

Greetings,
Cody
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Robert
Top achievements
Rank 1
answered on 12 Jun 2014, 03:10 PM
I'm trying to verify a URL and I included and Connect to URL and a Wait for URL but they fail.  I get this error  Wait for condition has timed out.  So, how can I verify a URL has loaded correctly? (it's in a new tabbed browser session)  I'd really like to be able to verify content in the new window, but it doesn't look like I can do that.

Help...

Rob
0
Ivaylo
Telerik team
answered on 17 Jun 2014, 07:46 AM
Hello Rob,

Let me interject into this ticket.

This would be possible using a coded step. Here is a sample code that I have used for verifying a pop-up URL but this should work in any case for the active browser:

string url1 = Manager.ActiveBrowser.Url.ToString();
Assert.IsTrue(url1.Equals(url2, StringComparison.OrdinalIgnoreCase));

Hope this helps.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Graham
Top achievements
Rank 1
Answers by
Cody
Telerik team
Robert
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or