You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I added the timeout capabilities(aws:maxDurationSecs & aws:idleTimeoutSecs) in DeviceFarmTarget.java as shown below its not getting reflected. Please see the devicefarm webdriver.log below
--------------------------DeviceFarmTarget.java--------------------------------- @OverRide
public Map<String, Object> start(Logger logger) {
logger.info("making request to aws for browser: {}", browserName);
logger.info(" sercurty key arn : {}", arn);
DeviceFarmClient client = DeviceFarmClient.builder().region(Region.US_WEST_2).build();
CreateTestGridUrlRequest request = CreateTestGridUrlRequest.builder()
.expiresInSeconds(86400)
.projectArn(arn)
.build();
// logger.info(" request: {}", request);
CreateTestGridUrlResponse response = client.createTestGridUrl(request);
// logger.info(" response: {}", response);
String webDriverUrl = response.url();
// logger.info("aws url provisioned: {}", webDriverUrl);
Map<String, Object> map = new HashMap();
map.put("type", driverType);
map.put("start", false);
map.put("webDriverUrl", webDriverUrl);
// this is needed because it can take a minute or two for the "desktop" to be provisioned by aws
map.put("httpConfig", Collections.singletonMap("readTimeout", 120000));
// refer: https://docs.aws.amazon.com/devicefarm/latest/testgrid/techref-support.html
Map<String, Object> session = new HashMap();
map.put("webDriverSession", session);
Map<String, Object> capabilities = new HashMap();
capabilities.put("browserName", browserName);
capabilities.put("aws:maxDurationSecs", 2400);
capabilities.put("aws:idleTimeoutSecs", 900);
session.put("capabilities", capabilities);
// for some reason, both are needed for aws device farm
session.put("desiredCapabilities", capabilities);
return map;
}
The AWS suggested was trying setting the timeout capabilities(aws:maxDurationSecs & aws:idleTimeoutSecs) inside alwaysMatch .However, In the above case its outside the alwaysMatch.
IF this is the case, how do we add this capabilities in the DeviceFarmTarget.java so that it reflects inside the alwaysMatch block. Please let me know if you have any suggestion.
@Idsbali completely up to you how you create the hash map, this is just example code, you are encouraged to do the research and figure out what should be passed. this has nothing to do with karate. take the help of someone who knows java well if required
When I added the timeout capabilities(aws:maxDurationSecs & aws:idleTimeoutSecs) in DeviceFarmTarget.java as shown below its not getting reflected. Please see the devicefarm webdriver.log below
--------------------------DeviceFarmTarget.java---------------------------------
@OverRide
public Map<String, Object> start(Logger logger) {
logger.info("making request to aws for browser: {}", browserName);
logger.info(" sercurty key arn : {}", arn);
DeviceFarmClient client = DeviceFarmClient.builder().region(Region.US_WEST_2).build();
CreateTestGridUrlRequest request = CreateTestGridUrlRequest.builder()
.expiresInSeconds(86400)
.projectArn(arn)
.build();
// logger.info(" request: {}", request);
CreateTestGridUrlResponse response = client.createTestGridUrl(request);
// logger.info(" response: {}", response);
String webDriverUrl = response.url();
// logger.info("aws url provisioned: {}", webDriverUrl);
Map<String, Object> map = new HashMap();
map.put("type", driverType);
map.put("start", false);
map.put("webDriverUrl", webDriverUrl);
// this is needed because it can take a minute or two for the "desktop" to be provisioned by aws
map.put("httpConfig", Collections.singletonMap("readTimeout", 120000));
// refer: https://docs.aws.amazon.com/devicefarm/latest/testgrid/techref-support.html
Map<String, Object> session = new HashMap();
map.put("webDriverSession", session);
Map<String, Object> capabilities = new HashMap();
capabilities.put("browserName", browserName);
capabilities.put("aws:maxDurationSecs", 2400);
capabilities.put("aws:idleTimeoutSecs", 900);
session.put("capabilities", capabilities);
----------------------------Webdriver.log-------------------------------
"capabilities": {
"alwaysMatch": {
"goog:chromeOptions": {
"args": [
"user-data-dir=C:\Users\testnode\chrome_user_data",
"--enable-logging --v=1"
]
}
},
"aws:idleTimeoutSecs": 240,
"aws:maxDurationSecs": 2400,
"browserName": "chrome"
}
The AWS suggested was trying setting the timeout capabilities(aws:maxDurationSecs & aws:idleTimeoutSecs) inside alwaysMatch .However, In the above case its outside the alwaysMatch.
IF this is the case, how do we add this capabilities in the DeviceFarmTarget.java so that it reflects inside the alwaysMatch block. Please let me know if you have any suggestion.
DeviceFarmTarget.docx
The text was updated successfully, but these errors were encountered: