Answer the question
In order to leave comments, you need to log in
Can't click on element inside frame. ElementNotInteractableException error?
There was a difficulty when working with iframe.
I need to somehow click on the last element with the bg-event-time-container class. but the click does not work and the system swears that ElementNotInteractableException
tried like this:
@FindAll({@FindBy(xpath = "//div[@class='bg-allowed fc-bgevent']")}) // Свободное время для врача
List<WebElementFacade> emptyShedulePlace;
public void clickLastFreeTimeForDoctor() {
List <WebElementFacade> empty = emptyShedulePlace.get(0).thenFindAll(".//div");
scrollIntoView(emptyShedulePlace.get(0));
System.out.println("size_ "+empty.size());
empty.get(empty.size()-1).click();
WebElement ele = empty.get(empty.size());
JavascriptExecutor executor = (JavascriptExecutor)empty;
executor.executeScript("arguments[0].click();", ele);
}
Answer the question
In order to leave comments, you need to log in
found a solution to the problem:
String appointmentSlotPatternNoRecord = "//div[@class='bg-allowed fc-bgevent']//div[@class='text-center bg-event-time']//span[text()= '%s']/ancestor::div[@class='bg-event-time-container']";
passed it the value for span and click in this case only worked
$(String.format(appointmentSlotPatternNoRecord, value)).waitUntilClickable().click();
Good afternoon!
If I'm not mistaken, then you need to switch to iframe. You cannot click on its elements without switching to it.
Useful related link:
https://www.guru99.com/handling-iframes-selenium.html
It is impossible to click iframe directly through XPath since it is an iframe. First we have to switch to the frame and then we can click using xpath.
driver.switchTo().frame("a077aa5e");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question