You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I intend to implement web-crawling app on the real device of android phone by using selendroid.
My little experience on selendroid doesn't make sure that what I did was right or not. So I would like you to point out what my problem is.
My problem is that, when I run my app which has the function of selendroid standalone server and client on real device of android phone,
I always get the following error: 'java.lang.String java.net.URL.toString()' on a null object reference
more details are here
03-02 12:00:22.527 25727-25727/com.shs.top.myapplication I/SelendroidLauncher: Starting Selendroid standalone on port 4444
03-02 12:00:22.555 25727-25727/com.shs.top.myapplication E/SelendroidLauncher: Error building server: Attempt to invoke virtual method 'java.lang.String java.net.URL.toString()' on a null object reference
Creat a function that calls SelendroidLauncher in MainActivity.java as follows.
public void startSelendroidServer() throws Exception {
if (selendroidServer != null) {
selendroidServer.stopSelendroid();
}
SelendroidConfiguration config = new SelendroidConfiguration();
selendroidServer = new SelendroidLauncher(config);
selendroidServer.launchSelendroid(); //---> always throw an exception
DesiredCapabilities caps = SelendroidCapabilities.android();
driver = new SelendroidDriver(new URL("http://127.0.0.1:4444/wd/hub"), caps);
}
Please refer to my MainActivity.java file below
Build project
There is no error after the completion of 'rebuild project' execution.
Please refer to my development environment below
Execute 'Run app' with real android device of 'LGE-LG-F460L Android 5.0.1, API21'
no error after 'Gradle Build'
Success on Install APKs
'My Application' app is successfully activated on android phone
but selendroid server is not started along with the following exception error:
com.shs.top.myapplication E/SelendroidLauncher: Error building server: Attempt to invoke virtual method 'java.lang.String java.net.URL.toString()' on a null object reference
Please help me to correct my problem. Thanks in advance.
p1: Development Environment
Android Studio 3.0.1
SDK installed : Android API 27, Android 8.0 (Oreo) API 26, Android 5.0(Lolipop) API 21
LGE-LG-F460L : Android 5.0.1, Kernel 3.10.40
Hello anyone,
I intend to implement web-crawling app on the real device of android phone by using selendroid.
My little experience on selendroid doesn't make sure that what I did was right or not. So I would like you to point out what my problem is.
My problem is that, when I run my app which has the function of selendroid standalone server and client on real device of android phone,
I always get the following error: 'java.lang.String java.net.URL.toString()' on a null object reference
more details are here
03-02 12:00:22.527 25727-25727/com.shs.top.myapplication I/SelendroidLauncher: Starting Selendroid standalone on port 4444
03-02 12:00:22.555 25727-25727/com.shs.top.myapplication E/SelendroidLauncher: Error building server: Attempt to invoke virtual method 'java.lang.String java.net.URL.toString()' on a null object reference
The steps which I have taken are as follows.
Create a project with android studio
Add two jar files in 'app/libs' folder as library
Creat a function that calls SelendroidLauncher in MainActivity.java as follows.
public void startSelendroidServer() throws Exception {
if (selendroidServer != null) {
selendroidServer.stopSelendroid();
}
}
Please refer to my MainActivity.java file below
Build project
There is no error after the completion of 'rebuild project' execution.
Please refer to my development environment below
Execute 'Run app' with real android device of 'LGE-LG-F460L Android 5.0.1, API21'
com.shs.top.myapplication E/SelendroidLauncher: Error building server: Attempt to invoke virtual method 'java.lang.String java.net.URL.toString()' on a null object reference
Please help me to correct my problem. Thanks in advance.
p1: Development Environment
Android Studio 3.0.1
SDK installed : Android API 27, Android 8.0 (Oreo) API 26, Android 5.0(Lolipop) API 21
LGE-LG-F460L : Android 5.0.1, Kernel 3.10.40
p2: MainActivity.java
package com.shs.top.myapplication;
p3: logcat log
The text was updated successfully, but these errors were encountered: