gpt4 book ai didi

java - org.openqa.selenium.SessionNotCreatedException

转载 作者:太空宇宙 更新时间:2023-11-04 11:16:00 27 4
gpt4 key购买 nike

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");
}
}

当我编写上述代码来验证应用程序时,我收到以下错误。

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. 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)

最佳答案

只需更新设备功能名称。您写的是 devicename 而不是 deviceName。

我遇到了同样的问题,通过上述更改解决了。

希望它对您有用。

关于java - org.openqa.selenium.SessionNotCreatedException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45456803/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com