If the HTML code looks like this
<div class="something">
<div>
<iframe src="something">
``` how would I be able to switch the iframe to that above using selenium in nodejs
If the HTML code looks like this
<div class="something">
<div>
<iframe src="something">
``` how would I be able to switch the iframe to that above using selenium in nodejs
To switch to the <iframe>
you can use the following lines of code:
// Store the web element
const iframe = driver.findElement(By.css('div.something > div > iframe[src="something"]'));
// Switch to the frame
await driver.switchTo().frame(iframe);