0
I have a problem with writing a value into an input element.
When Selenium appeals to this input field, the page scrolls to the top and the input hides behind the navigation bar.
Before appealing, I execute this code:
int elementPosition = element.getLocation().getY();
String js = String.format("window.scroll(0, %s)", elementPosition-90);
((JavascriptExecutor)driver).executeScript(js);
But even after my scroll, the input is still hidden.
Also, I tried to set a value to this field through JavaScript:
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].setAttribute('value', '"+date+"')",element);
Unfortunately, this does not help either.
Environment: Selenium 3.6.0 ver, FireFox 66 ver.