seleniumwebdriverqaf

QAF | Configure multiple Remote.server for the single multi driver run Mobile to Web and back


I have to switch drivers between the run to 2 different service providers in the same testcase/scenario.

Presently I'm using "env.resources" to set multiple Env details in different files, but "remote.server" in the 2nd env file always takes over.

Eg:

Web Test: BrowserStack | Appium/App Test: ExperiTest

I have referred following post, which talks predominantly about switching drivers but not multiple remote.server/port

Switch back and forth between drivers (across different environment) in qmetry

Multiple OS, browsers for parallel execution using Saucelabs and QAF framework

QAF - How to automate both WEB and MOBILE app using QAF

https://qmetry.github.io/qaf/qaf-2.1.13/properties_list.html

According to the below link, we can set up multiple environments, but how can I pass the env details during the run via switchDriver

https://qmetry.github.io/qaf/latest/managing_resources_for_different_env.html


Solution

  • Set "remote.server" using getBundle before calling the switchDriver or testBase

    getBundle().setProperty("remote.server","Remote server URL");
    
    switchDriver("chromeRemoteDriver"); // Common step from QAF
    (or)
    QAFTestBase testBase = getTestBase(); //TestBaseProvider.instance().get()
    testBase.setDriver("chromeRemoteDriver");