Невозможно запустить новую сессию на соусниках для моего мобильного сценария автоматизации селена - PullRequest
0 голосов
/ 12 ноября 2018

Запуск сценария автоматизации селена на соусах, но ошибка ниже. Не удалось найти причину сбоя. Примечание : - Также ссылались на подобные вопросы, заданные ранее по stackoverflow, но не помогли мне.

СБОЙ КОНФИГУРАЦИИ: настройка @BeforeClass org.openqa.selenium.remote.UnreachableBrowserException: не удалось начать новый сеанс. Возможные причины - неверный адрес удаленного Ошибка запуска сервера или браузера. Информация о сборке: версия: '2.48.2', ревизия: '41bccdd', время: '2015-10-09 19:59:12' Системная информация: хост: 'ULTP_444', ip: '172.24.7.181', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10 .0 ', java.version: '1.8.0_181' Информация о драйвере: driver.version: AndroidDriver в org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:641) в io.appium.java_client.DefaultGenericMobileDriver.execute (DefaultGenericMobileDriver.java:40) в io.appium.java_client.AppiumDriver.execute (AppiumDriver.java:1) на io.appium.java_client.android.AndroidDriver.execute (AndroidDriver.java:1) в org.openqa.selenium.remote.RemoteWebDriver.startSession (RemoteWebDriver.java:247) в org.openqa.selenium.remote.RemoteWebDriver. (RemoteWebDriver.java:129) в org.openqa.selenium.remote.RemoteWebDriver. (RemoteWebDriver.java:142) в io.appium.java_client.DefaultGenericMobileDriver. (DefaultGenericMobileDriver.java:36) в io.appium.java_client.AppiumDriver. (AppiumDriver.java:114) в io.appium.java_client.AppiumDriver. (AppiumDriver.java:132) в io.appium.java_client.android.AndroidDriver. (AndroidDriver.java:92) на com.automation.mobile.Tests.TestBase.setup (TestBase.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0 (собственный метод) at sun.reflect.NativeMethodAccessorImpl.invoke (неизвестный источник) at sun.reflect.DelegatingMethodAccessorImpl.invoke (неизвестный источник) в java.lang.reflect.Method.invoke (Неизвестный источник) в org.testng.internal.MethodInvocationHelper.invokeMethod (MethodInvocationHelper.java:85) в org.testng.internal.Invoker.invokeConfigurationMethod (Invoker.java:510) в org.testng.internal.Invoker.invokeConfigurations (Invoker.java:211) в org.testng.internal.Invoker.invokeConfigurations (Invoker.java:138) в org.testng.internal.TestMethodWorker.invokeBeforeClassMethods (TestMethodWorker.java:170) в org.testng.internal.TestMethodWorker.run (TestMethodWorker.java:104) в org.testng.TestRunner.privateRun (TestRunner.java:773) в org.testng.TestRunner.run (TestRunner.java:623) в org.testng.SuiteRunner.runTest (SuiteRunner.java:357) на org.testng.SuiteRunner.runSequentially (SuiteRunner.java:352) в org.testng.SuiteRunner.privateRun (SuiteRunner.java:310) в org.testng.SuiteRunner.run (SuiteRunner.java:259) на org.testng.SuiteRunnerWorker.runSuite (SuiteRunnerWorker.java:52) на org.testng.SuiteRunnerWorker.run (SuiteRunnerWorker.java:86) на org.testng.TestNG.runSuitesSequentially (TestNG.java:1185) atg.testng.TestNG.runSuitesLocally (TestNG.java:1110) на org.testng.TestNG.run (TestNG.java:1018) на org.testng.remote.AbstractRemoteTestNG.run (AbstractRemoteTestNG.java:114) в org.testng.remote.RemoteTestNG.initAndRun (RemoteTestNG.java:251) в org.testng.remote.RemoteTestNG.main (RemoteTestNG.java:77) Вызывается: org.openqa.selenium.WebDriverException: javax.net.ssl.SSLException: нераспознанное сообщение SSL, открытый текст связь? Информация о сборке: версия: '2.48.2', ревизия: '41bccdd', время: '2015-10-09 19:59:12' Системная информация: хост: 'ULTP_444', ip: '172.24.7.181', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10 .0 ', java.version: '1.8.0_181' Информация о драйвере: driver.version: AndroidDriverв io.appium.java_client.remote.AppiumCommandExecutor.execute (AppiumCommandExecutor.java:84) в org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:620) ... еще 35 Вызвано: javax.net.ssl.SSLException: Нераспознанное сообщение SSL, текстовое соединение? at sun.security.ssl.InputRecord.handleUnknownRecord (неизвестный источник) at sun.security.ssl.InputRecord.read (неизвестный источник) at sun.security.ssl.SSLSocketImpl.readRecord (неизвестный источник) at sun.security.ssl.SSLSocketImpl.performInitialHandshake (неизвестный источник) at sun.security.ssl.SSLSocketImpl.startHandshake (неизвестный источник) at sun.security.ssl.SSLSocketImpl.startHandshake (неизвестный источник) в org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket (SSLConnectionSocketFactory.java:394) в org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket (SSLConnectionSocketFactory.java:353) в org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect (DefaultHttpClientConnectionOperator.java:134) в org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect (PoolingHttpClientConnectionManager.java:353) в org.apache.http.impl.execchain.MainClientExec.establishRoute (MainClientExec.java:380) в org.apache.http.impl.execchain.MainClientExec.execute (MainClientExec.java:236) в org.apache.http.impl.execchain.ProtocolExec.execute (ProtocolExec.java:184) в org.apache.http.impl.execchain.RetryExec.execute (RetryExec.java:88) в org.apache.http.impl.execchain.RedirectExec.execute (RedirectExec.java:110) в org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:184) в org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:71) в org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:55) в org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute (ApacheHttpClient.java:143) в org.openqa.selenium.remote.internal.ApacheHttpClient.execute (ApacheHttpClient.java:89) в org.openqa.selenium.remote.HttpCommandExecutor.execute (HttpCommandExecutor.java:142) в io.appium.java_client.remote.AppiumCommandExecutor.execute (AppiumCommandExecutor.java:69)

Ниже мой сценарий селена: -

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.Assert;
import org.testng.ITestResult;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.AndroidMobileCapabilityType;


public class TestBase {
    AppiumDriver<MobileElement> driver;
    public static final String USERNAME = "xxx";
    public static final String ACCESS_KEY = "yyy";
    public static final String URL = "https://" + USERNAME + ":" + ACCESS_KEY + "@ondemand.saucelabs.com:80/wd/hub";

    @BeforeClass
    public void setup() throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("name", "Calculator_test");
        capabilities.setCapability("deviceName", "Samsung Galaxy S4 Emulator");
        capabilities.setCapability("platformVersion", "4.4");
        capabilities.setCapability("platformName", "Android");
        capabilities.setCapability("noReset", "true");
        capabilities.setCapability("fullReset", "false");
        capabilities.setCapability("browserName", "");
        capabilities.setCapability("appiumVersion", "1.5.3");
        capabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.android.calculator2");
        capabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, "com.android.calculator2.Calculator");

        driver=new AndroidDriver<MobileElement>(new URL(URL),capabilities);

        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

    }

    @Test
    public void run() {
        driver.findElementById("com.android.calculator2:id/digit_7").click();
        driver.findElementByAccessibilityId("plus").click();
        driver.findElementByXPath("//*[@text='2']").click();
        driver.findElementByAccessibilityId("equals").click();
        String result=driver.findElementById("com.android.calculator2:id/result").getText();
        if(result.equals("9"))
            Assert.assertTrue(true);
        else
            Assert.assertTrue(false);
    }

    @AfterClass
    public void tearDown(ITestResult result) {
        ((JavascriptExecutor) driver).executeScript("sauce:job-result=" + (result.isSuccess() ? "passed" : "failed"));
        driver.quit();
    }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...