Note that there are some explanatory texts on larger screens.

plurals
  1. POJava-Selenium WebElement is not found error
    text
    copied!<p>I have some problem with selenium.</p> <p>I want to send some <code>String content</code> to an element on my web with id= "source" and submit it here is my code</p> <pre><code>driver.get("http://hiriji.com/"); WebElement viet = driver.findElement(By.id("source")); viet.sendKeys(content); viet.submit(); </code></pre> <p>it works well, until the content is too big.</p> <p>after</p> <pre><code>viet.sendKeys(content); </code></pre> <p>the web suddenly change to 404 error page. So it got an error at</p> <pre><code>viet.submit(); </code></pre> <p>My question is how to ignore this error and continue with the below code. I don't need to send all content to the web, if it is too big it can be ignored...</p> <p>the stacktrace said:</p> <pre><code>Exception in thread "main" org.openqa.selenium.StaleElementReferenceException: Element not found in the cache - perhaps the page has changed since it was looked up Command duration or timeout: 392 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:09:54' System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_31' Driver info: driver.version: RemoteWebDriver org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:498) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:244) at org.openqa.selenium.remote.RemoteWebElement.submit(RemoteWebElement.java:81) at RecieveData.TranslateStatus.translateViToEn(TranslateStatus.java:22) at RecieveData.htmlParser.parseHtml(htmlParser.java:43) at RecieveData.AddressToHtml.parseHtmlStatus(AddressToHtml.java:105) at RecieveData.MainProcess.main(MainProcess.java:29) Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Element not found in the cache - perhaps the page has changed since it was looked up Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:09:54' System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_31' Driver info: driver.version: unknown </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload