SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

StaleElementReferenceException while selecting dropdown option that changes current web page on Android emulator #4517

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 4517

If we have an select element with options that changes web page to another WebDriver
throws exception while selecting it.

Example page:

<html>
<head>
 <title>Select test</title>
</head>
<body>

  <select name="sel" onchange="if(this.selectedIndex==1) location.replace('another.html')">
   <option value="opt1">Option 1</option>
   <option value="opt2">Option 2</option>
   <option value="opt3">Option 3</option>
  </select>

</body>
</html>

What steps will reproduce the problem?
1. Launch web driver on android emulator
2. Run test with 'option 2' selecting on the test page

WebElement = wDriver.findElement(By.name("sel"))
Select select = New Select(we);
select.selectByVisibleText("Option 2");
// or select.selectByIndex(1);

3. See the StaleElementReferenceException thrown

What is the expected output? 
The expected output is 'another.html' loaded and no any exceptions

What do you see instead?
I see another.html loaded an the emulator, but I see also StaleElementReferenceException
thrown.

Selenium version:
OS: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_32'
Browser: Android WebDriver 2.21 on emulator of Android 4.0.3.
Browser version: Android WebDriver 2.21

Reported by SergeyVladimirovitch on 2012-09-06 15:41:05

lukeis commented 8 years ago
Selenium version: 2.25.0 and 2.24.1

Reported by SergeyVladimirovitch on 2012-09-06 15:47:59

lukeis commented 8 years ago

Reported by barancev on 2012-09-11 08:38:07

lukeis commented 8 years ago
Selenium project no longer supports the AndroidDriver.

Please use Selendroid instead:
http://selendroid.io/webview.html

And log any issues against that project:
https://github.com/selendroid/selendroid/issues

Reported by luke.semerau on 2013-12-26 21:57:35

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:16:07