2 Answers
- Newest
- Most votes
- Most comments
1
Hi there,
Thank you for reaching out. Device Farm Mobile Device Testing operates uses a server-side, rather than client-side, execution model. This means that you would instead package your tests according to our instructions here (https://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-appium.html), then upload them to Device Farm for testing against a pool of devices. In particular, in your test code, you would put code such as the following to indicate that you are using server-side execution during your driver setup method:
[code]
@BeforeSuite
public void setUpDriver() {
if (System.getenv("DEVICEFARM_DEVICE_NAME") == null) {
// This runs against device farm desktop browser devices, client-side
String myProjectARN = "arn:evicefarm:us-west-2:XXXXXXXXXX:testgrid-project:XXXXXXXX";
DeviceFarmClient client = DeviceFarmClient.builder()
.region(Region.US_WEST_2)
.build();
CreateTestGridUrlRequest request = CreateTestGridUrlRequest.builder()
.expiresInSeconds(300)
.projectArn(myProjectARN)
.build();
CreateTestGridUrlResponse response = client.createTestGridUrl(request);
URL testGridUrl = new URL(response.url());
WebDriver driver = new RemoteWebDriver(testGridUrl, DesiredCapabilities.chrome());
else {
// This runs against device farm mobile devices, server-side
driver = new AndroidDriver(
new URL("http://127.0.0.1:4723/wd/hub"),
new DesiredCapabilities());
}
}
[/code]
Please give this code and those linked instructions a try and let us know your thoughts.
Thank you
answered 3 years ago
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago