SeleniumHQ / selenium-google-code-issue-archive

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

AndroidDriver#executeScript(...) doesn't work for scripts containing line breaks. #4816

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 4816

What steps will reproduce the problem?
1. call AndroidDriver#executeScript("return \n true");

What is the expected output? What do you see instead?

true is expected, but null is returned

Selenium version: 2.25
OS: Linux
Browser: Android
Browser version: 4.1

Reported by jan.papousek on 2012-11-23 14:09:42

lukeis commented 8 years ago

Reported by adamgoucher on 2012-11-26 15:54:34

lukeis commented 8 years ago
The code in the original bug report is not correct; JavaScript automatic semicolon insertion
turns that line of code into "return; true" so it can be expected that it would not
return true. This is per the spec and will occur everywhere. However, I can verify
that any code passed to executeScript containing newlines does not work correctly in
AndroidDriver and returns null when it should not. Modifying the original test case
code to be either "\nreturn true" or "return true\n" triggers the bug. "return true"
works.

Reported by google@zetafleet.com on 2013-10-24 16:01:40

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:25