[英]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.