2

since I updated the chromedriver version, I have encountered a problem. If I use chromedriver version 113 or 114, I am unable to retrieve any of the elements within a specific iframe. However, I can access elements within other iframes without any issues. On the other hand, I don't have any problems with chromedriver version 112. What could be happening?

I have tried multiple ways to retrieve the elements within the problematic iframe using chromedriver version 113, but I have been unsuccessful. If I target the iframe like this:

WebElement element = driver.findElement(By.id("window_id_1_content"));
driver.switchTo().frame(element);
List<WebElement> elements = driver.findElements(By.xpath("//*"));

The response I receive is that there are no elements in the list. However, in version 112, even though I don't need to switch to the iframe to successfully retrieve its elements, I do get results when I execute the same code. This is the iframe that is causing problems (I have modified the src).

<iframe name="window_id_1_content" id="window_id_1_content" src="/blalalalala/blalalalal/blalalalal.do?&amp;SESSION_CLIENT_STATE=window_id_1" style="height: 389px; width: 1246px; visibility: visible;" cd_frame_id_="666066666666d66c66ab01ecf26e4be7" class=""> </iframe>

@Greg Burghardt Thanks.

sergio
  • 21
  • 4
  • Can you share the URL if it is public? – Shawn May 19 '23 at 15:57
  • what version of java are you using? is the base url https://localhost ? – djmonki May 21 '23 at 10:31
  • The URL is not public, @Shawn, it's corporate. As I mentioned before, it's an iframe that is nested within a table. With chromedriver 113, I'm unable to access its elements, but with version 112, there's no problem. Regarding the Java version I'm using, it's 11, and no, the URL is not localhost. Best regards. – sergio May 22 '23 at 14:47
  • I wonder if you need to wait for the iframe to load. Is there an element inside the iframe you are interested in? You could switch to the iframe, and then use an explicit wait for that single element. – Greg Burghardt May 22 '23 at 19:43
  • Within the iframe, there are elements that I need. It's not a timing issue because I debug with IntelliJ to navigate to the failing screen, and I spend a good amount of time there conducting tests. The iframe has plenty of time to load while I perform these tests. Thanks, @Greg Burghardt. – sergio May 23 '23 at 08:11
  • Please [edit] your question to include a relevant amount of the HTML in the iframe, including ancestor elements above the iframe. Be sure it includes descendant elements inside the iframe that you are interested in. Otherwise, we cannot answer your question. – Greg Burghardt May 23 '23 at 13:54

0 Answers0