简体   繁体   English

org.openqa.selenium.SessionNotCreatedException

[英]org.openqa.selenium.SessionNotCreatedException

  1. I am getting error org.openqa.selenium.SessionNotCreatedException: once i execute the code 我收到错误org.openqa.selenium.SessionNotCreatedException:执行代码后

    package SignUp; 包注册;

    import java.net.URL; 导入java.net.URL; import java.util.concurrent.TimeUnit; 导入java.util.concurrent.TimeUnit; import org.openqa.selenium.By; 导入org.openqa.selenium.By; import org.openqa.selenium.remote.DesiredCapabilities; 导入org.openqa.selenium.remote.DesiredCapabilities; import org.testng.annotations.BeforeT enter code here est; 导入org.testng.annotations.BeforeT enter code here est; import org.testng.annotations.Test; 导入org.testng.annotations.Test;

    import io.appium.java_client.ios.IOSDriver; 导入io.appium.java_client.ios.IOSDriver;

    public class SignUPBaseclass { public IOSDriver driver; 公共类SignUPBaseclass {公共IOSDriver驱动程序;
    @BeforeTest public void SignUp1() throws Exception { DesiredCapabilities capabilities = new DesiredCapabilities(); @BeforeTest公共无效SignUp1()引发异常{DesiredCapabilities功能=新的DesiredCapabilities(); capabilities.setCapability("appium-version", "1.0"); abilities.setCapability(“ appium-version”,“ 1.0”); capabilities.setCapability("platformName", "iOS"); abilities.setCapability(“ platformName”,“ iOS”); capabilities.setCapability("platformVersion", "9.3"); abilities.setCapability(“ platformVersion”,“ 9.3”); capabilities.setCapability("deviceName", "iPhone 5S Plus"); abilities.setCapability(“ deviceName”,“ iPhone 5S Plus”); capabilities.setCapability("app", "/Users/sumit/Desktop/Project /FSFosh-1.ipa"); abilities.setCapability(“ app”,“ / Users / sumit / Desktop / Project /FSFosh-1.ipa”); IOSDriver driver = new IOSDriver(new URL(" http://127.0.0.1:4725/wd/hub "), capabilities); IOSDriver驱动程序=新的IOSDriver(新的URL(“ http://127.0.0.1:4725/wd/hub ”),功能); driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); driver.manage()。timeouts()。implicitlyWait(60,TimeUnit.SECONDS);

      } 

    @Test public void Flow(){ driver.findElement(By.name("JOIN US FREE!")).click(); @Test public void Flow(){driver.findElement(By.name(“ JOIN US FREE!”))。click(); //AppiumCapabilities App_Cap = new AppiumCapabilities(); // AppiumCapabilities App_Cap = new AppiumCapabilities(); //App_Cap.driver.findElement(By.name("JOIN US FREE!")).click(); //App_Cap.driver.findElement(By.name("JOIN US FREE!“))。click();

      } /*@AfterClass //public void tearDown() { AppiumCapabilities App_Cap = new AppiumCapabilities(); App_Cap.driver.quit(); }*/ 

    } }

    Error Message 错误信息

    [TestNG] Running: [TestNG]正在运行:
    /private/var/folders/6r/_2b4t0zj1tj95nkmxmj9c5n40000gp/T/testng-eclipse-2068198674/testng-customsuite.xml /private/var/folders/6r/_2b4t0zj1tj95nkmxmj9c5n40000gp/T/testng-eclipse-2068198674/testng-customsuite.xml

    log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies). log4j:WARN找不到记录器的附加程序(org.apache.http.client.protocol.RequestAddCookies)。 log4j:WARN Please initialize the log4j system properly. log4j:WARN请正确初始化log4j系统。 FAILED CONFIGURATION: @BeforeTest SignUp1 org.openqa.selenium.SessionNotCreatedException: A new session could not be created. 失败的配置:@BeforeTest SignUp1 org.openqa.selenium.SessionNotCreatedException:无法创建新的会话。 (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 469 milliseconds Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40' System info: host: 'Appster-Sumit-Nagar.local', ip: '172.16.17.71', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.3', java.version: '1.7.0_80' Driver info: io.appium.java_client.ios.IOSDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remot (原始错误:请求了一个新会话,但正在进行中)(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:469毫秒内部版本信息:版本:'2.53.0',修订版:'35ae25b',时间:'2016-03-15 16:57:40'系统信息:主机:'Appster-Sumit-Nagar.local',ip:'172.16.17.71',操作系统名称:'Mac OS X',os.arch :'x86_64',os.version:'10 .11.3',java.version:'1.7.0_80'驱动程序信息:sun处的io.appium.java_client.ios.IOSDriver.sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)在org.openqa处的java.lang.reflect.Constructor.newInstance(Constructor.java:526)处的sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)处的.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) org.openqa.selenium.remot上的selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)在org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)在org.openqa.selenium.remot e.RemoteWebDriver.execute(RemoteWebDriver.java:678) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:158) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:109) at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:23) at SignUp.SignUPBaseclass.SignUp1(SignUPBaseclass.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510) at org.testng.int org上的io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)的org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)的e.RemoteWebDriver.execute(RemoteWebDriver.java:678) org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:158)上的.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:131),位于io.appium.java_client.AppiumDriver。(AppiumDriver.java:109)在io.appium.java_client.ios.IOSDriver。(IOSDriver.java:23)在SignUp.SignUPBaseclass.SignUp1(SignUPBaseclass.java:23)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)在sun.reflect.NativeMethodAccessorImpl。 org.testng.internal.MethodInvocationHelper.invokeMethod处的java.lang.reflect.Method.invoke(Method.java:606)处的sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)处的invoke(NativeMethodAccessorImpl.java:57) (MethodInvocationHelper.java:85)在org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)在org.testng.int ernal.Invoker.invokeConfigurations(Invoker.java:211) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.TestRunner.beforeRun(TestRunner.java:648) at org.testng.TestRunner.run(TestRunner.java:616) at org.testng.SuiteRunner.runTest(SuiteRunner.java:359) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312) at org.testng.SuiteRunner.run(SuiteRunner.java:261) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215) at org.testng.TestNG.runSuitesLocally(TestNG.java:1140) at org.testng.TestNG.run(TestNG.java:1048) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:112) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:176) org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)位于org.testng.TestRunner.beforeRun(TestRunner.java:648)位于org.testng.TestRunner处的ernal.Invoker.invokeConfigurations(Invoker.java:211) org.testng.SuiteRunner.run上的.run(TestRunner.java:616).org.testng.SuiteRunner.run上的.run(SuiteRunner.java:359)org.testng.SuiteRunner.privateRun(SuiteRunner。 org.testng.SuiteRunner.run(SuiteRunner.java:261)处的org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)处的org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)处的java:312) org.testng.TestNG.run(TestNG.java:1048)在org.testng.TestNG.runSuitesLocally(TestNG.java:1140)在org.testng.TestNG.run(TestNG.java:1048)在org.testng.remote org.testng.remote.RemoteTestNG.init.Run.RemoteTestNG.run(RemoteTestNG.java:112)org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:176)上的.RemoteTestNG.run(RemoteTestNG.java:112)

    SKIPPED: Flow 跳过:流程

    =============================================== Default test Tests run: 1, Failures: 0, Skips: 1 ==============================================默认测试测试运行:1,失败:0,跳过:1

    Configuration Failures: 1, Skips: 0 配置失败:1,跳过:0

    =============================================== ==============================================

    Default suite 默认套件

    Total tests run: 1, Failures: 0, Skips: 1 Configuration Failures: 1, 运行的测试总数:1,失败:0,跳过:1配置失败:1,

    Skips: 0 跳过:0

    [TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 194 ms [TestNG] Time taken by org.testng.reporters.jq.Main@be71839: 322 ms [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@118e0f0f: 119 ms [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@1f80ce47: 21 ms [TestNG] Time taken by org.testng.reporters.XMLReporter@3f611531: 88 ms [TestNG] Time taken by org.testng.reporters.EmailableReporter2@582ed819: 8 msenter code here [TestNG] [FailedReporter通过= 0失败= 0跳过= 0]所花费的时间:194毫秒[TestNG] org.testng.reporters.jq.Main@be71839所花费的时间:322 ms [TestNG] org.testng所花费的时间.reporters.SuiteHTMLReporter @ 118e0f0f:119毫秒[TestNG] org.testng.reporters.JUnitReportReporter@1f80ce47花费的时间:21毫秒[TestNG] org.testng.reporters.XMLReporter@3f611531花费的时间:88毫秒[TestNG]花费的时间通过org.testng.reporters.EmailableReporter2@582ed819:8个此处的代码

Issue has been resolved here , here i just created "RemoteWebDriver" object instead of IOSDriver .. 问题已在此处解决,这里我只是创建了“ RemoteWebDriver”对象,而不是IOSDriver ..

public class SignUPBaseclass extends Testbase {
public RemoteWebDriver driver;

@BeforeTest
public RemoteWebDriver SignUp1() throws Throwable  {

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("appium-version", "1.0");
    capabilities.setCapability("platformName", "iOS");
    capabilities.setCapability("platformVersion", "9.3");
    capabilities.setCapability("deviceName", "iPhone 5S Plus");
    capabilities.setCapability("app", "/Users/sumit/Desktop/Project /FSFosh-1.ipa");
     driver = new RemoteWebDriver(new URL("http://127.0.0.1:4725/wd/hub"), capabilities);
    return driver;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.openqa.selenium.SessionNotCreatedException - org.openqa.selenium.SessionNotCreatedException SeleniumError:org.openqa.selenium.SessionNotCreatedException - SeleniumError : org.openqa.selenium.SessionNotCreatedException org.openqa.selenium.SessionNotCreatedException 与 Appium - org.openqa.selenium.SessionNotCreatedException with Appium Appium _org.openqa.selenium.SessionNotCreatedException - Appium _org.openqa.selenium.SessionNotCreatedException 如何解决org.openqa.selenium.SessionNotCreatedException硒网格3 - How to solve org.openqa.selenium.SessionNotCreatedException selenium grid 3 Appium \\ MAC OS \\ Android \\ Java-org.openqa.selenium.SessionNotCreatedException - Appium \ MAC OS \ Android \ Java - org.openqa.selenium.SessionNotCreatedException org.openqa.selenium.SessionNotCreatedException:无法找到匹配的功能集 - org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities org.openqa.selenium.SessionNotCreatedException:会话未为Chrome创建异常 - org.openqa.selenium.SessionNotCreatedException: session not created exception for Chrome org.openqa.selenium.SessionNotCreatedException:所需功能错误 - org.openqa.selenium.SessionNotCreatedException: desired capabilities error Firefox 驱动程序失败并出现 org.openqa.selenium.SessionNotCreatedException: - Firefox Driver fails with org.openqa.selenium.SessionNotCreatedException:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM