Search in sources :

Example 1 with AgentBrowser

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);
        }
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) AgentBrowser(com.testsigma.agent.browsers.AgentBrowser) Browsers(com.testsigma.automator.entity.Browsers) DriversUpdateService(com.testsigma.automator.drivers.DriversUpdateService) OsBrowserType(com.testsigma.automator.entity.OsBrowserType)

Example 2 with AgentBrowser

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);
    }
}
Also used : AgentBrowser(com.testsigma.agent.browsers.AgentBrowser) ArrayList(java.util.ArrayList)

Example 3 with AgentBrowser

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");
        }
    }
}
Also used : AgentBrowser(com.testsigma.agent.browsers.AgentBrowser) WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability) File(java.io.File)

Aggregations

AgentBrowser (com.testsigma.agent.browsers.AgentBrowser)3 DriversUpdateService (com.testsigma.automator.drivers.DriversUpdateService)1 WebDriverCapability (com.testsigma.automator.drivers.WebDriverCapability)1 Browsers (com.testsigma.automator.entity.Browsers)1 OsBrowserType (com.testsigma.automator.entity.OsBrowserType)1 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1