Forum Discussion

Naynab's avatar
Naynab
Occasional Contributor
3 months ago
Solved

Regarding URL change in Existing keyword recording

Hi,

 

Recently our applications URL has been change little bit so we would like to change it with new one and use the existing recording. How do we change or update the URL in existing recording of tests.

  • Create a variable that holds the URL that you need. Use that variable in the keyword test instead of the actual URL. If you give me an example of a keyword test where you use the URL, I can show you how to change it.

  • create a variable called URL and assign it your new value

    in your Operation Parameters, for the URL entry, use the three dots at the end of the Value box to choose this variable instead of entering the URL itself

    your test will now pull the value from the variable to use as the URL

     

    do this everywhere you use the URL in your tests and you will only ever have to change the variable value in one place and not in every script

12 Replies

    • Naynab's avatar
      Naynab
      Occasional Contributor

      Thank you for quick response.

      So we have Keyword tests recording not the script based tests. Not sure how di refactor code or script in Keyword testing. 

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Create a variable that holds the URL that you need. Use that variable in the keyword test instead of the actual URL. If you give me an example of a keyword test where you use the URL, I can show you how to change it.

  • Naynab's avatar
    Naynab
    Occasional Contributor

    Thank you so much. I will try it out today to implement Variable for URL change. 

    • Naynab's avatar
      Naynab
      Occasional Contributor

      Hi,

       

      So I tried your solution however it is not working for our application somehow not able to find the login screen and it fails right there. do you have any other workaround ?

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Screenshots of the failure would be helpful.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    If you are using the v1 URL in one place and the v2 URL in another place, then you'll need to have separate variables for each one and use each one in the appropriate line of code.