I am currently working on a project in Selenium that is specifically designed to run in Internet Explorer, but I am encountering issues locating the xpath element.
Despite this setback, I managed to make progress in the test by using the switch frame function.
The error arises when attempting to switch to the "frame1" frame or identify the element with the ID txtChassi:
Exception in thread "main" org.openqa.selenium.NoSuchFrameException: No frame element found by name or id frame1
Exception in thread "main" org. openqa.selenium.NoSuchElementException: Unable to find element with css selector == #txtChassi
Attempt One:
driver0.switchTo().frame("frame1");
WebElement IptBoxChassi = driver0.findElement(By.id("txtChassi"));
IptBoxChassi.sendKeys(rs.getString(cChassi));
Attempt Two:
WebDriverWait waitIptBoxChassi = new WebDriverWait(driver0, 10);
waitIptBoxChassi.until(ExpectedConditions.visibilityOfElementLocated(By.id("txtChassi")));
WebElement IptBoxChassi = driver0.findElement(By.id("txtChassi"));
IptBoxChassi.sendKeys(rs.getString(cChassi));
Additional Error and WebPage Data:
https://i.sstatic.net/jkaUC.png
<FRAME noResize marginHeight=0 src="tela_topo.asp" frameBorder=no name=top marginWidth=0 scrolling=no target="contents">
... (more HTML code snippets and descriptive texts)
The WebDriver fails to locate the element within the frame, resulting in this error.
https://i.sstatic.net/FJHOd.png
... (more HTML code snippets and descriptive texts)