简体   繁体   中英

Geo Locator with selenium code for opentest

OpenTest (Selenium code)

How Can I include a GEO location in order to get a different test according with the country?

The page has three option in a country filed, that the test most read option1 if the Country is 1 and option 2 when the country is 2 then just read "Locator" if the user is not in option 1 or 2.

I'm not sure I completely understand your scenario, but it sounds like you could use the execution environments feature of OpenTest (more information here ). Just create two different environments for the two countries and store the country code in an environment-specific data file, something like this:

test-repo/data-env/us/config.yaml

countryCode: US

Then, you can use the expression $data("config").countryCode to read the country code and perform conditional logic based on that in your tests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM