Forum Discussion

sudam_evonsys's avatar
sudam_evonsys
Occasional Contributor
3 months ago

Execute same keyword test script for different environments

Hi All,

I'm working on a product that was developed with Pega and facing an issue when trying to execute the same script for a different environment (both environments have the same version of the product). Initially, I created a keyword test on the UAT environment and Now, I'm unable to run the same script for the INT environment as it is unable to locate the elements. 

Then I created the same script for the INT environment and realized it maintained different name mapping locators for the INT environment. (It has the same XPath)

Can someone help avoid this and run these same scripts for different environments? 

Note: I have added a sample locator which is duplicated due to environment difference.

8 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    See Using Wildcards which can be used in name mappings.

    The parent object i.e. the browser should be defined as http://pega-*app-02.inside note the wildcard * being used. All your other child objects will be beneath this. Therefore, there's no need to define the name mappings twice, for each environment.

    • sudam_evonsys's avatar
      sudam_evonsys
      Occasional Contributor

      I have tried to pass the main URL as a variable as an attached screen. but it was not recognized the INT environment's element when executing on INT environment (pass INT URL while executing on INT for variable value)

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        Your ObjectType URL is referring to,

        How will that work, for the INT environment!?