Forum Discussion

hilary_davis's avatar
hilary_davis
Occasional Contributor
13 years ago

Keyword Test: Trying to Test Multiple URLs – without having to change multiple parameters or variables

We are web testing our company websites. The main differences between the 13 sites are their URLs and logos. The functionality of each site is the same.

We would like to setup ONE project which would include multiple keyword tests items within the project. In order to test each of the 13 sites, we only want to have to change the Company’s URL in ONE LOCATION within the project





Example:

PROJECT: TESTING COMPANY WEBSITES

Keyword Test:



  • Launch browser and navigate to Company URL


  • Test links on landing page


  • Click Contact tab at top


  • Test links on Contact page


  • Test contact forum functionality


  • Etc.


  • Etc.


  • Etc.


What we have tried:



  • Setting up parameters within each Keyword Test Item for each URL – This is not an acceptable solution for us, because it is forcing us to change the parameter in EACH Keyword Test Item, which would take too long.


  • Setup a variable within the Project Suite - This is not an acceptable solution for us, because it is forcing us to change the variable in EACH Keyword Test Item, which would take too long.


Is there a way we can setup a variable/parameter that would change EACH of its associated variable/parameter item within ALL Keyword Test Items?

Is there a way to change just ONE variable/parameter within the Keyword Test Item ‘Launch Browser and Navigate to Company URL” [from www.companyexample.com to www.example2.com], and then expect TestComplete to automatically change the rest of the URLs within each Keyword Test Item in the entire project?

1 Reply


  • Hi Hilary,


     


    You may have one project variable that will contain the link to the page to be tested. You can name it pageURL, for example. You will use this variable in your test to navigate to the needed page. 


     


    The next task is to assign a value to the variable. This can be done using the DDT feature. For example, you will have the Excel file that will contain the list of URLs that you need to test. At the beginning of each test, you will obtain a new URL and use it for testing. Watch this lesson - it will help you better understand the DDT feature.


    Another way is to pass the link to the tested page via TestComplete's command line. At that beginning of the test, you will need to obtain the command-line parameter and assign it to the pageURL variable.