<iframe id="vacancy_department_requirements_ifr" frameborder="0" src="javascript:""" allowtransparency="true" title="Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help" style="width: 100%; height: 100px; display: block;">
<!DOCTYPE html>
<html>
I am having problem in switching the iframes while automating the application using webdriver. There are three texteditor. And when I do inspect element then at the same iframe id the id changes. so I am unable to switch in between the frames.
I wrote the following code:-
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("vacancy_job_requirements_ifr"));
WebElement element2 = driver.findElement(By.cssSelector("body"));
JavascriptExecutor executor3 = (JavascriptExecutor)driver;
executor3.executeScript("arguments[0].innerHTML = '<h1>Set text using innerHTML2</h1>'", element2);
*/
/*wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("vacancy_job_description_ifr"));
WebElement element3 = driver.findElement(By.cssSelector("body"));
JavascriptExecutor executor4 = (JavascriptExecutor)driver;
executor4.executeScript("arguments[0].innerHTML = '<h1>Set text using innerHTML2 gf</h1>'", element3);
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("vacancy_department_requirements_ifr"));
WebElement element4 = driver.findElement(By.cssSelector("body"));
JavascriptExecutor executor5 = (JavascriptExecutor)driver;
executor5.executeScript("arguments[0].innerHTML = '<h1>Set text using innerHTML3 gf</h1>'", element4);*/
But the above code is giving me following error:
"Timed out after 120 seconds waiting for frame to be available: vacancy_job_description_ifr'
Please suggest.