use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.
the class FirefoxDriver method setTestsigmaLabCapabilities.
@Override
public void setTestsigmaLabCapabilities() throws AutomatorException {
if (!"Linux".equals(getPlatform())) {
MutableCapabilities mutableCapabilities = new MutableCapabilities();
mutableCapabilities.setCapability(TSCapabilityType.SELENIUM_VERSION, "3.8.1");
mutableCapabilities.setCapability(TSCapabilityType.NAME, executionName);
mutableCapabilities.setCapability(EnvSettingsConstants.KEY_MAX_IDLE_TIME, EnvSettingsConstants.MAX_IDLE_TIME);
mutableCapabilities.setCapability(EnvSettingsConstants.KEY_MAX_DURATION, EnvSettingsConstants.MAX_DURATION);
mutableCapabilities.setCapability("username", this.getTestDeviceEntity().getUsername());
mutableCapabilities.setCapability("accessKey", this.getTestDeviceEntity().getAccessKey());
capabilities.add(new WebDriverCapability(TSCapabilityType.TESTSIGMA_LAB_OPTIONS, mutableCapabilities));
setTestsigmaLabRemoteServerUrl();
} else {
super.setTestsigmaLabCapabilities();
}
capabilities.add(new WebDriverCapability(CapabilityType.BROWSER_NAME, BrowserType.FIREFOX));
}
use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.
the class WebDriver method setCommonCapabilities.
@Override
protected void setCommonCapabilities() throws AutomatorException {
super.setCommonCapabilities();
capabilities.add(new WebDriverCapability(TSCapabilityType.NAME, executionName));
capabilities.add(new WebDriverCapability(TSCapabilityType.ACCEPT_SSL_CERTS, Boolean.TRUE));
capabilities.add(new WebDriverCapability(TSCapabilityType.UNHANDLED_PROMPT_BEHAVIOUR_KEY, TSCapabilityType.UNHANDLED_PROMPT_BEHAVIOUR_VALUE));
}
use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.
the class DriverSessionsService method createSession.
public String createSession(DriverSessionRequest driverSessionRequest) throws Exception {
com.testsigma.agent.dto.WebDriverSettingsDTO webDriverSettingsDTO;
if (ExecutionLabType.Hybrid.equals(driverSessionRequest.getExecutionLabType()) && WorkspaceType.isMobileApp(driverSessionRequest.getWorkspaceType())) {
disconnectDeviceSession(driverSessionRequest.getUniqueId());
driverSessionRequest.setWebDriverServerUrl(new URL(mobileAutomationServer.getServerURL()));
}
webDriverSettingsDTO = fetchWebDriverSettings(driverSessionRequest);
log.info("Creating a remote web driver session with settings - " + webDriverSettingsDTO);
TestsigmaDriver testsigmaDriver = getDriverInstance(driverSessionRequest);
List<WebDriverCapability> caps = webDriverSettingsDTO.getWebDriverCapabilities();
addMissingTimeOutCapability(caps);
handleLocalDevice(caps, driverSessionRequest);
setRemoteServerURL(testsigmaDriver, driverSessionRequest, webDriverSettingsDTO);
testsigmaDriver.setCapabilities(caps);
RemoteWebDriver remoteWebDriver = testsigmaDriver.createSession();
String sessionId = populateSessionIdMaps(remoteWebDriver, driverSessionRequest);
sendMobileSessionStartedRequest(sessionId, driverSessionRequest);
return sessionId;
}
use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.
the class DriverSessionsService method appendChromeDriverExecutable.
private void appendChromeDriverExecutable(List<WebDriverCapability> caps, DriverSessionRequest driverSessionRequest) throws TestsigmaException {
MobileDevice device = deviceContainer.getDevice(driverSessionRequest.getUniqueId());
if (device.getBrowserList() != null && device.getBrowserList().size() > 0) {
AgentBrowser browser = device.getBrowserList().get(0);
File chromePath = driverExecutableExists(Browsers.GoogleChrome.getKey(), browser.getMajorVersion() + "");
if (chromePath != null) {
WebDriverCapability cap = new WebDriverCapability(TSCapabilityType.CHROME_DRIVER_EXECUTABLE, chromePath.getAbsolutePath());
caps.add(cap);
} else {
log.warn("Chrome Driver is not yet downloaded.. please try after some time");
}
}
}
use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.
the class DriverSessionsService method setupIosDevice.
public void setupIosDevice(List<WebDriverCapability> caps, DriverSessionRequest driverSessionRequest) throws TestsigmaException, AutomatorException {
MobileDevice device = deviceContainer.getDevice(driverSessionRequest.getUniqueId());
iosDeviceService.setupWda(device);
WebDriverCapability bundleIdCapability = caps.stream().filter(cap -> cap.getCapabilityName().equals(TSCapabilityType.BUNDLE_ID)).findFirst().orElse(null);
if ((bundleIdCapability == null) || StringUtils.isBlank((String) bundleIdCapability.getCapabilityValue())) {
WebDriverCapability appCapability = caps.stream().filter(cap -> cap.getCapabilityName().equals(MobileCapabilityType.APP)).findFirst().orElse(null);
AppPathType appPathType = driverSessionRequest.getApplicationPathType();
if ((appCapability != null) && appPathType != AppPathType.APP_DETAILS) {
caps.remove(appCapability);
String appPresignedUrl = (String) appCapability.getCapabilityValue();
String bundleId = iosDeviceService.installApp(device, appPresignedUrl);
caps.add(new WebDriverCapability(TSCapabilityType.BUNDLE_ID, bundleId));
}
}
}
Aggregations