以下是我正在使用的所需功能
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Browser");
capabilities.setCapability("automationName","Appium");
capabilities.setCapability("platformName", "Android");
//capabilities.setCapability("avd","firstavd");
capabilities.setCapability("deviceName", "Android Emulator");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
当我执行以下代码时 - 使用上述所需的上限
driver.navigate().to(url);
driver.findElementByLinkText("Start").click();
它在其他 avd 中工作得非常好。浏览器启动并加载 url。但是在bluestacks中,我遇到了以下异常:
org.openqa.selenium.NoSuchWindowException: A request to switch to a different window could not be satisfied because the window could not be found.
Appium server: info: [debug] Responding to client with error: {"status":23,"value":{"message":"A request to switch to a different window could not be satisfied because the window could not be found.","origValue":"no such window: window was already closed\n (Session info: webview=)\n (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64)"},"sessionId":"ba7131af61cad9451da99dd750d61fa8"}
怎么了。我不想切换任何窗口。我哪里错了?