1

These are the steps that my code is running.

I start the chromedriver with the secure shell appt - no issues, it launches the browser and appt correctly

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

I then navigate using driver get to the chrome URL setup page to send connection data.

driver.get("chrome-extension://pnhechapfaindjhompbnflcldabbghjo/html/nassh.html");

While on this page from the image below, I tried to send keys or click on any of the fields with sendkeys or click and I get the following error. I have tried multiple ways and im getting the same results: org.openqa.selenium.WebDriverException: unknown error: Cannot set property 'value' of null

Here is my code

//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';");

Question: Is this even possible, I see an id and the id is unique; furthermore, I also tried xpath and received the same result. Thoughts

Secure shell chrome Breift description: Terminal emulator and SSH client. Secure Shell is an xterm-compatible terminal emulator and stand-alone ssh client for Chrome. It uses Native-Client to connect directly to ssh servers without the need for external proxies. https://chrome.google.com/webstore/detail/secure-shell-extension/iodihamcpbpeioajjeobimgagajmlibd

2 Answers 2

1

Update your ChromeDriver to 2.37 (the latest) from https://sites.google.com/a/chromium.org/chromedriver/downloads

I think that you are using Chrome v65

Sign up to request clarification or add additional context in comments.

3 Comments

Running 2.37, that was my first thought when I encounter this problem. Thanks anyways
I was facing the same issue, updating the driver solved my problem.
ChromeDriver 2.37 is where they Fixed an issue with handling iframe on Chrome v66. The release notes chromedriver.storage.googleapis.com/2.37/notes.txt has more details
0

The issue was frame related. I used this code to identified how many frames and then send keys to the correct frame. phew!

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.