Just resolved it! Before executing sendKeys(), do this:
JavascriptExecutor js=(JavascriptExecutor)driver;
js.executeScript("arguments[0].scrollIntoView(true);", element);
On Thursday, April 7, 2016 at 12:13:05 PM UTC-4, Viktor Amkhinich wrote:
>
> Jenkins ver. 1.642.4
> Launching from localhost:8080
> Java jdk1.8.0_40
>
> The website page I'm testing using Selenium WebDriver has an <input
> type='file'... tag, that is initially hidden (due to some UI requirements).
> I make it visible, and then use WebElement sendKeys(file-path) method to
> initiate file upload. Works fine in Eclipse, but fails in Jenkins with
> *Element
> is not currently visible and so may not be interacted with* message.
> Here's the element in question:
> <input style="display: block;height:20px;width:30px" name="fileToUpload"
> id="fileToUpload" data-bind-id="sharemsg-fileupload-input" title="Choose
> File" multiple="multiple" type="file">
> I also print isDisplayed() element property, and in Eclipse it is true, in
> Jenkins false. That's the difference, but why?
>
> Thanks
>
> Viktor
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/df24f4b0-5efa-42ba-b6a8-35d3eee934ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.