2018/07/01

When there # of iFrames in certain web page, it is possible that findelement will not work if you search element from other iframe.

solution: switch to desired Iframe before run find element. e.g.


driver.SwitchTo().Frame(driver.FindElement(By.CssSelector("div#tabUsers77 iframe")));

var el=driver.FindElement(By.CssSelector("div#id123"));


When you've finished interacting with the elements within the frame, you'll need to switch back to the main webpage.

driver.switchTo().defaultContent();


https://stackoverflow.com/questions/17680022/selenium-webdriver-cannot-locate-element-within-an-iframe-and-throws-nosuchelem

Selenium WebDriver cannot locate element within an iframe, and throws NoSuchElementException

I BUILT MY SITE FOR FREE USING