2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
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
답변함 3년 전
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 3년 전