Forum Discussion

magicalsue's avatar
magicalsue
New Contributor
7 years ago

Using current URL?

Is there a way for Test Complete to use the currently opened URL instead of navigating to pre populated URL from within the test?

Our product has different URL's for each client version, so I have to modify my tests each time for the client under test.

  • Or you could use the different URLs as part of a data-driven test and read them from a file into that variable.  That way you could run one set of tests or multiple ones just by changing the data file.

     

    Also be sure to shut down the browser at the end of your test.  

  • cunderw's avatar
    cunderw
    Community Hero

    I would use a project variable that your tests call for the URL. This way you only have to change in one place. 

     

    You could even use the start test event handler to set the value from a config file or environment variable at run time. 

    • Marsha_R's avatar
      Marsha_R
      Moderator

      Or you could use the different URLs as part of a data-driven test and read them from a file into that variable.  That way you could run one set of tests or multiple ones just by changing the data file.

       

      Also be sure to shut down the browser at the end of your test.