0

I am getting this error:

org.openqa.selenium.ElementNotVisibleException: You may only interact with visible elements

when I use HtmlUnitDriver. It works for URL, after that when I start with

driver.findElement(By.cssSelector("#from_city_typeahead")).sendKeys("bangalore"); 

such statements, it gives the above error. Help me to solve this issue.

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
ash
  • 59
  • 1
  • 6

1 Answers1

-1

You can do the same action with javascript:

webdriver.executeScript("document.getElementById('elementID').setAttribute('value', 'new value for element')");

Visibility does matter in case of standard visible browsers. But it's doesnt matter for javascript in case of any of browsers.

Andrew_STOP_RU_WAR_IN_UA
  • 9,318
  • 5
  • 65
  • 101