Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solo.clickOnWebElement throws NullPointerException #602

Closed
renas opened this issue Aug 20, 2015 · 5 comments
Closed

solo.clickOnWebElement throws NullPointerException #602

renas opened this issue Aug 20, 2015 · 5 comments

Comments

@renas
Copy link
Contributor

renas commented Aug 20, 2015

From zhangpin...@gmail.com on September 26, 2013 18:00:43

hi,group
My robotium version is:robotium-solo-4.3.jar,android os version is:4.1.2
I can use solo.clickOnButton() and other solo method to operate elements in my test project,but when I act in a WebView,I call solo.clickOnWebElement(By.id(***)),it throws NullPointerException,trace is below,pls give me a glance,thanks!
java.lang.NullPointerException
at java.io.Reader.(Reader.java:64)
at java.io.InputStreamReader.(InputStreamReader.java:122)
at java.io.InputStreamReader.(InputStreamReader.java:59)
at com.jayway.android.robotium.solo.WebUtils.getJavaScriptAsString(WebUtils.java:315)
at com.jayway.android.robotium.solo.WebUtils.prepareForStartOfJavascriptExecution(WebUtils.java:142)
at com.jayway.android.robotium.solo.WebUtils.executeJavaScriptFunction(WebUtils.java:248)
at com.jayway.android.robotium.solo.WebUtils.executeJavaScript(WebUtils.java:211)
at com.jayway.android.robotium.solo.WebUtils.getCurrentWebElements(WebUtils.java:102)
at com.jayway.android.robotium.solo.Searcher.searchForWebElement(Searcher.java:239)
at com.jayway.android.robotium.solo.Waiter.waitForWebElement(Waiter.java:332)
at com.jayway.android.robotium.solo.Clicker.clickOnWebElement(Clicker.java:318)
at com.jayway.android.robotium.solo.Solo.clickOnWebElement(Solo.java:868)
at com.android.test.MyAccount.RegisterAccountsList.test1_listShow(RegisterAccountsList.java:82)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584)

Original issue: http://code.google.com/p/robotium/issues/detail?id=523

@renas
Copy link
Contributor Author

renas commented Aug 20, 2015

From renasr...@gmail.com on September 26, 2013 21:17:32

The javascript file seems to be null. Download a new version of the robotium jar and clean your test project. https://code.google.com/p/robotium/downloads/list

Status: Invalid
Owner: renasr...@gmail.com

@renas
Copy link
Contributor Author

renas commented Aug 20, 2015

From zhangpin...@gmail.com on September 27, 2013 02:22:42

I downloaded newest version of robotium published on Sep 9,2013,and cleaned the test project,but it can not take effect,java.lang.NullPointerException still throws out,can you give me some other advise about this question?Maybe test project should set special setting to suport javascript execution?
thank you very much!

@renas
Copy link
Contributor Author

renas commented Aug 20, 2015

From renasr...@gmail.com on September 27, 2013 02:25:55

There is no need for anything special. You are the only one reporting this. Im not sure why you are getting the issue.

@renas
Copy link
Contributor Author

renas commented Aug 20, 2015

From zhangpin...@gmail.com on September 28, 2013 19:46:06

I run my test on real device,android os version of the device is 4.1.2,but my develop env. android sdk version is android 4.2.2,will it be conflict?Thanks your kindness help!

@renas
Copy link
Contributor Author

renas commented Aug 20, 2015

From alexschn...@googlemail.com on February 20, 2014 06:43:32

Hi, we had the same problem. We just added " *.js " to the compiler ressource patterns in the Preferences (in this case in IntelliJ. And then the error didn't occur anymore. Maybe this could help you.
Cheers.

@renas renas closed this as completed Aug 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant