Forum Discussion

Leela1's avatar
Leela1
Occasional Contributor
4 years ago
Solved

Dynamic Url

Thank you to the Smearbear Support group for helping me move forward  I have couple of questions, hope some one can answer them 🙂 and thank you very much.   I want to use the same keyword test I ...
  • AlexKaras's avatar
    4 years ago

    Hi,

     

    Personally I would do it this way:

    a) Create a string project variable of temporary type (with default value, say, https://aa.abc.avista.edu/GRT/page);

    b) Depending on how you are going to execute your tests on another environments, consider how to assign the proper value to the above variable. Possible options: manually; from the command line as a custom parameter; read from configuration file; implement this or that data loop; etc.

    c) Modify test code that starts browser and performs initial navigation so that the code uses the value of the above temporary project variable (which, by that moment, must contain correct value);

    d) Revise NameMapping and remove site URL from the list of identification parameters for as many objects as possible. Investigate your tested application and find other unique, static and stable properties that can be used for this or that object identification and adjust NameMapping appropriately;

    e) For the objects where URL as an identification parameter is required or highly desirable (can't think about anything else but Page), edit its identification parameters so that instead of static hardcoded value this parameter referenced the abovementioned project variable.