以下是我的代码正在运行的步骤。
我用安全外壳appt启动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);然后使用驱动程序get导航到chrome设置页面以发送连接数据。
driver.get("chrome-extension://pnhechapfaindjhompbnflcldabbghjo/html/nassh.html");在此页面上,从下面的图像,我试图发送键或单击任何字段的sendkey或单击,我得到以下错误。我尝试过多种方法,并获得了相同的结果: org.openqa.selenium.WebDriverException: unknown :无法设置属性‘值’为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是唯一的;此外,我还尝试了并得到了相同的结果。思考

Breift描述:终端模拟器和SSH客户端。Secure是一个与xterm兼容的终端模拟器,也是Chrome的独立ssh客户端。它使用本机客户机直接连接到ssh服务器,而不需要外部代理。https://chrome.google.com/webstore/detail/secure-shell-extension/iodihamcpbpeioajjeobimgagajmlibd
发布于 2018-03-29 07:15:22
从ChromeDriver将ChromeDriver更新为2.37 (最新)
我认为你在使用Chrome v65
发布于 2018-03-29 13:11:53
这一问题与框架有关。我使用这段代码来识别多少帧,然后将键发送到正确的帧。哎呀!
int size = driver.findElements(By.tagName("iframe")).size();
System.out.println(size);
driver.switchTo().frame(1); // Switching the inner Frame with 1 0 for outer fram
driver.findElement(By.xpath("//*[@id='field-description']")).sendKeys("9109");https://stackoverflow.com/questions/49547881
复制相似问题