I have a problem with one element on the web page. When I want somehow to interact with it(click on it, sendKeys or something) and every time I'm getting an error IDE view. In the browser I can click on this button and I locate it right browser view. All other elements on this website are working well. My task is to upload a file. In this case i want to make this -> filePathUploadButton.sendKeys("C:\\Users\\ASuvorkov\\Desktop\\testverlG_serenity.png")
.
Manually it would be so:
- User clicks on this button
- Then user selects file in dialog
- And the user clicks on "open file" to upload a file
Do you have any suggestions or experience with it, because I didn't meet such kind of things yet?
PS even checking if element.isEnabled()
, element.isDisplayed()
causes this error and programm breaks up.
Code snippet(JAVA):
@FindBy(id = "fileupload") private WebElement filePathUploadButton;
public void downloadCoverPicture() {
waitABit(LONG_WAIT);
element(mediaTypeDropDownButton).waitUntilClickable();
mediaTypeDropDownButton.click();
element(mediaTypeDropDownList).waitUntilClickable();
mediaTypeDropDownList.click();
waitABit(LONG_WAIT);
element(filePathUploadButton).waitUntilClickable();
filePathUploadButton.sendKeys("C:\\Users\\ASuvorkov\\Desktop\\testverlG_serenity.png");
waitABit(50000);
}
Error stacktrace:
org.openqa.selenium.ElementNotVisibleException: The following error occurred: Timed out after 10 seconds. Element not available
at pages.NewBookAddPage.downloadCoverPicture(NewBookAddPage.java:71)
at steps.NewBookManagementSteps.downloadsCoverPicture(NewBookManagementSteps.java:52)
at tests.NewBookManagementTest.addsNewBook(NewBookManagementTest.java:43)