I’m just trying to get a single test for both of Mobile Operative System
I’m using Cucumber as test framework for example that feature:
Scenario Outline: Test app
When Start Test "<Platform>"
Then Do the test
Examples:
| Platform |
| Android |
| IOS |
Calls to my Test.java:
public class Test {
public <typeofvariable> driver;
@When("Start Test {string}")
public Start_test (String platform){
if (platform.equals("Android"))
{
driver = new InitAndroidDriver();
}
else { driver = new InitIOSDriver();}
}
@When("Do the test")
public Do_the_test{
driver.context("NATIVE_APP");
}
}
But I don’t know what type of variable needs to be “driver” to accept AndroidDriver and also IOSDriver, I tried putting AppiumDriver in but It not works for me, because in the “Do the test” section I need to switch between context and AppiumDriver dont seems to have that function.
Appreciate the help.