use of com.testsigma.agent.browsers.AgentBrowser in project testsigma by testsigmahq.
the class DeviceContainer method syncBrowserDrivers.
public void syncBrowserDrivers(MobileDevice mobileDevice) {
log.info("Syncing Browser Drivers For Mobile Devices - " + mobileDevice);
List<AgentBrowser> browserList = mobileDevice.getBrowserList();
if (browserList == null) {
return;
}
for (AgentBrowser browserObj : browserList) {
try {
log.info("Trying to sync driver for mobile browser - " + browserObj);
OsBrowserType browserType = browserObj.getName();
String browserVersion = browserObj.getMajorVersion() + "";
Browsers browser = OsBrowserType.getBrowserType(browserType);
String driverPath = AutomatorConfig.getInstance().getAppBridge().getDriverExecutablePath(browser.getKey(), browserVersion);
new DriversUpdateService().syncBrowserDriver(browserType, browserVersion, driverPath);
} catch (AutomatorException e) {
log.error(e.getMessage(), e);
}
}
}
use of com.testsigma.agent.browsers.AgentBrowser in project testsigma by testsigmahq.
the class AndroidDeviceListener method populateBrowserList.
private void populateBrowserList(MobileDevice mobileDevice, IDevice device) throws AdbCommandExecutionException {
boolean isChromeInstalled = commandExecutor.isPackageInstalled(device, "com.android.chrome");
if (isChromeInstalled) {
List<AgentBrowser> browserList = new ArrayList<>();
String version = commandExecutor.getChromeVersion(device);
AgentBrowser browser = new AgentBrowser(OsBrowserType.Chrome, version, 64);
browserList.add(browser);
mobileDevice.setBrowserList(browserList);
}
}
use of com.testsigma.agent.browsers.AgentBrowser 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");
}
}
}
Aggregations