这些是我的代码正在运行的步骤。
我用secure shell应用程序启动chromedriver-没有问题,它可以正确启动浏览器和应用程序
chromeOptions.addExtensions(new File("src/test/resources/win32/browserprofile/Secure-Shell-App_v0.8.43.crx"));
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
然后,我使用驱动程序导航到chrome URL设置页面以发送连接数据。
driver.get("chrome-extension://pnhechapfaindjhompbnflcldabbghjo/html/nassh.html");
在下面图像的页面上,我试图发送密钥或单击带有sendkeys的任何字段,或单击,但出现以下错误。
我尝试了多种方法,我得到了相同的结果:org。openqa。硒。WebDriverException:未知错误:无法将属性“value”设置为null
这是我的密码
//Webdriver
driver.findElement(By.xpath("//*[@id='field-description']")).sendKeys("aabb");
driver.findElement(By.id("field-username")).click();
driver.findElement(By.id("field-username")).sendKeys("useridval");
driver.findElement(By.id("field-hostname")).click();
driver.findElement(By.id("field-hostname")).sendKeys("10.0.0.0");
//JavascriptExecutor
// This will execute JavaScript in your script
((JavascriptExecutor)driver).executeScript("document.getElementById('field-username').value='migsrcrfuser';");
问:这是否可能,我看到一个id,并且id是唯一的;此外,我还尝试了xpath,得到了相同的结果
。想法
Breift描述:终端仿真器和SSH客户端。
Secure Shell是一个与xterm兼容的终端仿真器,是Chrome的独立ssh客户端。它使用本机客户端直接连接到ssh服务器,而不需要外部代理。
https://chrome.google.com/webstore/detail/secure-shell-extension/iodihamcpbpeioajjeobimgagajmlibd