Forum Discussion

Naynab's avatar
Naynab
Occasional Contributor
2 years 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.

  • Functions that reside in other scripts, and that are linked with USEUNIT, effectively become part of the current script.

    You can call them "dynamically" as in your first example like so:

    //USEUNIT My_File
    function test(){
      var functions = ["button_one", "button_two", "button_three"]
      for (var i = 0; i < functions.length; i++){
        var button = My_File[functions[i]]();
        button.Click()
      }
    }

     

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
        Icon for Champion Level 3 rankChampion 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
        Icon for Champion Level 3 rankChampion Level 3

        Screenshots of the failure would be helpful.

  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion 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.