URL verification?

4 posts, 0 answers
  1. Graham
    Graham avatar
    4 posts
    Member since:
    May 2011

    Posted 19 May 2011 Link to this post

    Is it possible to verify the URL of the current page?
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 19 May 2011 Link to this post

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

  3. Robert
    Robert avatar
    10 posts
    Member since:
    Oct 2008

    Posted 12 Jun 2014 in reply to Cody Link to this post

    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
  4. Ivaylo
    Admin
    Ivaylo avatar
    782 posts

    Posted 17 Jun 2014 Link to this post

    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!
Back to Top