SeleniumHQ / selenium-google-code-issue-archive

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

Android random NullReferenceExceptions using dotnet assemblies #6429

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 6429

Hi,

I've come across a weird problem while developing automated tests using WebDriver.
My current target is mobile testing, and I'm using AndroidDriver. This issue seems
to be coming from the Android APK WebDriver server, I presume something went wrong
during the deserialization of the JSON response received from Android.
This exception is very infrequent, but I'll describe the exact steps I used when I
received it last time:

What steps will reproduce the problem?
1. Browse to http://beta.m.travelzoo.com/top20/
2. Look for the following element like this: Selenium.FindElement(By.CssSelector("[data-taid='LinkTop20Deal16']"));

What is the expected output? What do you see instead?
The element is found, since it IS present on the page.

Selenium version: 2.35.0.0 .NET 4, C#
OS: Windows 8 x64 Enterprise
Browser: Android WebKit Integrated Browser
Remote OS: Android 4.2.2 x86 Intel emulated
Remote Android APK Version: 2.32.0

Here's the call stack I mined from the exception:
   at OpenQA.Selenium.Remote.RemoteWebDriver.GetElementsFromResponse(Response response)
   at OpenQA.Selenium.Remote.RemoteWebDriver.FindElements(String mechanism, String
value)
   at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementsByCssSelector(String cssSelector)
   at OpenQA.Selenium.By.<>c__DisplayClass1e.<CssSelector>b__1d(ISearchContext context)
   at OpenQA.Selenium.By.FindElements(ISearchContext context)
   at OpenQA.Selenium.Remote.RemoteWebDriver.FindElements(By by)
   at [User Code]

The message is 'Object reference not set to an instance of an object.'. It doesn't
have any inner exceptions.

I really wish I could provide more details, but using this configuration I've come
across a dozen random-like issues using Android. I use the exact same Solution and
methods with FirefoxDriver with absolutely no problems.

Reported by andor.baranyi@lateral-inc.com on 2013-10-18 14:51:43

lukeis commented 8 years ago

Reported by barancev on 2013-10-18 15:20:37

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

lukeis commented 8 years ago

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