Simply put, for some reason the site I’m working with has set up this section of inputs as follows:
<iframe title="parentIframe">
#document (https://www.website.com)
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<div id="root">
<div id="firstDiv">
... //the iframes are within an arbitrary number of divs
<iframe title="firstChildIframe">
#document (https://www.website.com/subsite1)
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<input name="firstInput" />
</body>
</html>
</iframe>
...
</div>
<div id="secondDiv">
...
<iframe title="secondChildIframe">
#document (https://www.website.com/subsite2)
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<input name="secondInput" />
</body>
</html>
</iframe>
...
</div>
<div id="thirdDiv">
...
<iframe title="thirdChildIframe">
#document (https://www.website.com/subsite3)
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<input name="thirdInput" />
</body>
</html>
</iframe>
...
</div>
</div>
</body>
</html>
</iframe>
For automated testing, we are using some fork of webdriver with nodeJS, and I have hit a wall.
I have tried using this.focusFrame()
and browser.switchToFrame()
with //iframe[@title="____ChildIframe"]
and iframe[title="____ChildIframe"]
, both of which work in the Inspect/Elements search bar of Chrome, but I just can’t seem to find a way to make this work.
Once inside the parent iframe using this.focusFrame('//iframe[@title="parentIframe"]')
, the runner stays frozen and doesn’t do anything, probably looking for the first iframe child on a loop and never finding it. I have no idea what I’m missing. Perhaps, since the iFrame contents are being loaded in a different site or are part of a different HTML, the runner doesn’t know what to do? What am I missing?
Thanks for your help!