简体   繁体   English

org.openqa.selenium.SessionNotCreatedException

[英]org.openqa.selenium.SessionNotCreatedException

public class Admin     
{

    public static void main(String args[]) throws MalformedURLException
    {
        DesiredCapabilities cap=new DesiredCapabilities();
        cap.setCapability("automationName", "android");
        cap.setCapability("platformName", "Appium");
        cap.setCapability("Version", "7.1.1");
        cap.setCapability("devicename", "HT4AXJT00193");
        cap.setCapability("appActivity", "com.bcqms.cgs.MainActivity");
        cap.setCapability("appPackage", "com.bcqms.cgs");

        AppiumDriver<WebElement> driver=new AndroidDriver<WebElement>(newURL("http://0.0.0.0:4723/wd/hub"),cap); 
        driver.findElementById("inputEmail3").sendKeys("admin");
        driver.findElementById("inputPassword3").sendKeys("jsmith");
    }
}

While I am writing the above code for authentication of the app I am getting the following error. 在编写上述代码进行应用程序身份验证时,出现以下错误。

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. 线程“主”中的异常org.openqa.selenium.SessionNotCreatedException:无法创建新的会话。 Details: The desiredCapabilities object was not valid for the following reason(s): deviceName can't be blank, automationName android not part of Appium,Selendroid,UiAutomator2,XCUITest,YouiEngine, (WARNING: The server did not provide any stacktrace information) 详细信息:出于以下原因,desirableCapabilities对象无效:deviceName不能为空,automationName android不是Appium,Selendroid,UiAutomator2,XCUITest,YouiEngine的一部分,(警告:服务器未提供任何堆栈跟踪信息)

Just update device capability name. 只需更新设备功能名称。 you have written devicename instead of deviceName. 您已经写了设备名而不是设备名。

I had the same issue, resolved with above changes. 我遇到了同样的问题,并通过上述更改解决了。

Hope it will work for you. 希望它对您有用。

声明:本站的技术帖子网页,遵循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