- Newest
- Most votes
- Most comments
Hello Sekar,
Thank you for reaching out to us .
You are getting above issue because you are trying to start server instance before execute any test cases. We recommend to have condition check that if the code is running on device farm then they do not need to start a server instance but instead connect to the one already created at 127.0.0.1:4723/wd/hub
Sample code attached
final String URL_STRING = "http://127.0.0.1:4723/wd/hub";
URL url = new URL(URL_STRING);
//Use a empty DesiredCapabilities object
DesiredCapabilities capabilities = new DesiredCapabilities();
if (System.getenv("DEVICEFARM_DEVICE_NAME") == null) {
//Start an Appium server and set the DesiredCapabilities capabilities only for local development
}
// Else, I am running on Device Farm, so I dont need to set capabilities
driver = new AndroidDriver(url, capabilities);
Thank you, Narmadha/Team !!
The aforementioned solution worked for Android, but it's not working yet for iOS.
Error:
Failed to invoke configuration method mobile.iosapp.common.IosBaseTest.setUpIosApp:com.google.common.base.Platform.stringIsNullOrEmpty(Ljava/lang/String;)Z
[TestNG] FAILED CONFIGURATION: "iOS Regression Tests" - @BeforeClass mobile.iosapp.common.IosBaseTest.setUpIosApp(org.testng.ITestContext)(value(s): org.testng.TestRunner@2a7686a7) finished in 0 ms
[TestNG] java.lang.NoSuchMethodError: com.google.common.base.Platform.stringIsNullOrEmpty(Ljava/lang/String;)Z
BaseTest class:
`
DesiredCapabilities capabilities = new DesiredCapabilities();
loadConfigProperties();
if (System.getenv("DEVICEFARM_DEVICE_NAME") == null) {
startServer();
appiumDriver = iosCapabilities("ios_demo_app");
} else {
System.out.println("####### new implementation - config properties are loading #######");
capabilities.setCapability("BUNDLE_ID", configProperties.getProperty("ios_bundle_id"));
capabilities.setCapability(
"PLATFORM_NAME", configProperties.getProperty("ios_platform_name"));
capabilities.setCapability(
"AUTOMATION_NAME", configProperties.getProperty("ios_automation_name"));
System.out.println("bundle id is : " + configProperties.getProperty("ios_bundle_id"));
System.out.println("####### new implementation successful #######");
appiumDriver = new IOSDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
appiumDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);}`
Could you please help If the usage of any dependency is not correct ?
Reagrds, Sekar
Hello Guys,
The aforementioned issue has been fixed after excluding the google collections jar in the maven-site-plugin. I am able to run the iOS tests in the AWS console successfully now.
<exclusion> <groupId>com.google.collections</groupId> <artifactId>google-collections</artifactId> </exclusion>
Relevant content
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago