while using real Android device I got "Selendroid server on the device didn't came up" - selendroid

I tried to automated android device Galaxy S4 (v4.2.2).
I started with the "getting started" as appear in the selendroid.io web
I used selendroid-standalone-0.10.0-with-dependencies.jar
tried to automate the app tha the web provide as training : selendroid-test-app0.10.0.ap
java jdk 1.8
ADT was installed
by typing "adb devices " - I see the android device as well
the selendroid-standalone-0.10.0-with-dependencies.jar and the app were placed in teh same folder
6.. I run the command :
java -jar selendroid-standalone-0.10.0-with-dependencies.jar -app selendroid-test-app-0.10.0.apk" -- and 4444 port was opened as needed
Now , when I tried to run the follwing code :
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
public class login {
public static void main(String[] args) throws Exception {
SelendroidCapabilities capa = new SelendroidCapabilities("io.selendroid.testapp:0.10.0");
WebDriver driver = new SelendroidDriver(capa);
}
}
and I got the following exceptions :
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Selendroid server on the device didn't came up after 20sec:

stop the selendroid server from command prompt (press ctrl+C) and uninstall the apk in your device if the apk is already installed.
Now install the resigned apk (which is already created when you run the selendroid server previously) in your device
Now start the selendroid server from your command promt like "java -jar -aut <.apk>"
Now, run your test. It will run without any error

Even I was getting this error.
Fix :
Don't install the app under test by yourself on the device/emulator.
Let selendroid resign and install the apk by itself.

Related

java - Selenium WebDriver failed to create chrome process

So I have been trying to make a program that can interact with a webpage to input data. I ideally wanted to use Chrome so I tried to set up Selenium WebDriver and ChromeDriver.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class Chrome {
public static void main(String[] args) {
//Set chromedriver path
System.setProperty("webdriver.chrome.driver","C:/Users/Username/Desktop/Comp Sci work/chromedriver.exe");
WebDriver driver = new ChromeDriver();
// Open Google
driver.get("http://www.google.com");
// Maximize browser
driver.manage().window().maximize();
}
}
I seem to have set up the external JARs correctly as I can import them with no problem. The problem is for some reason the Chrome process cannot be created. I thought this might've been because there was already a Chrome process open but no. I still got the same error when I killed the process.
I then tried to set reset the path to Chrome, as the default one might've been different to mine, but still no luck.
public class Chrome {
public static void main(String[] args) {
//Set chromedriver path
System.setProperty("webdriver.chrome.driver","C:/Users/Username/Desktop/Comp Sci work/chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setBinary("C:\\Users\\Username\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe");
WebDriver driver = new ChromeDriver();
// Open Google
driver.get("http://www.google.com");
// Maximize browser
driver.manage().window().maximize();
}
}
The error message is:
Starting ChromeDriver 2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e)
on port 43997
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown
error: Failed to create a Chrome process.
(Driver info: chromedriver=2.41.578737
(49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134
x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 199 milliseconds
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-
02T20:05:20.749Z'
As the chromedriver seems to start fine the problem is simply in creating the chrome process but I can't seem to find out why. Any help would be appreciated(Also tips about my post formatting, as this is my first post). Thanks
I meet this problem today,and solved it finally.it's because the chrome run as Administrator.so java can't start it.
Google Chrome Properties->Compatibility->not run as administrator
(for Mac) Change binary path from
/Applications/Google\ Chrome.app
..to:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

not able to debug play framework 2.6.x application in Scala IDE

I am new to Play, I have installed SBT 1.0.2, Scala IDE 4.6.1, from play documentation downloaded play-scala-starter-example project, i want to debug the project, i did following things.
set environment variables SBT_OPTS to -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
tried to run the project with "sbt -jvm-debug 9999 run" but it gives "Not a valid command: jvm-debug"
ran it with "sbt run" and in Scala IDE, i created following configuration,
and added breakpoints in HomeController of sample project, but when i refresh the page running on port 9000 doesnt stop, and when i use "Scala Debugger (Socket Attach) it gives error "Failed to connect to remote VM. Connection timed out." Scala IDE Configuration
I was having trouble setting the enviroment on windows 10 play 2.6, the way I found for play to start listen to the debug port was adding in projectfolder\sbt-dist\conf\sbtconfig , after #Set the extra SBT options:
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
though it will open socket every time you run sbt
1) Add sbt eclipse plugin in you project.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2")
2) Set the environment as for debugging follow
set SBT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5555
sbt run
3) Attache debugger to remote application in eclipse as
i) In Eclipse, right-click your project, then choose Debug As -> Debug Configurations...
ii) Right-click Remote Java Application, then click New.
The host should already be set to localhost. Set the port to 5555 (the default port used by the play debug run command).
iii)Click Apply to save, then Debug to connect to your running Play instance

Setup libGDX project using MOE plugin

How to setup the libGDX project using MOE plugin.
If i try to select ios-moe at the setup of libGDX project then my build fails with following error.
Generating app in
/Users/USERNAME/Desktop/PaxPlay/libGDXProjects/SampleGame Executing
'/Users/USERNAME/Desktop/PaxPlay/libGDXProjects/SampleGame/gradlew
clean --no-daemon' To honour the JVM settings for this build a new JVM
will be forked. Please consider using the daemon:
https://docs.gradle.org/2.10/userguide/gradle_daemon.html.
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project
'SampleGame'.
Could not resolve all dependencies for configuration ':classpath'.
Could not find com.intel.gradle:moeGradlePlugin:1.1.0.final-1.
Searched in the following locations:
file:/Users/USERNAME/.m2/repository/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
file:/Users/USERNAME/.m2/repository/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
https://repo1.maven.org/maven2/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
https://repo1.maven.org/maven2/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
https://oss.sonatype.org/content/repositories/snapshots/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
https://oss.sonatype.org/content/repositories/snapshots/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
file:/Applications/Intel/multi_os_engine/gradle/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
file:/Applications/Intel/multi_os_engine/gradle/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
Required by: :SampleGame:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info
or --debug option to get more log output.
BUILD FAILED
Total time: 8.492 secs Done! To import in Eclipse: File -> Import ->
Gradle -> Gradle Project To import to Intellij IDEA: File -> Open ->
build.gradle To import to NetBeans: File -> Open Project...
I had the same problem from time to time. Use the newest version of the multi os engine, which requires no local installation.
Multi-OS Engine Release 1.1.0
Samples Repository on GitHub

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

Code use:
enter code here
ProfilesIni profile = new ProfilesIni();
FirefoxProfile ffprofile = profile.getProfile("Other");
WebDriver driver = new FirefoxDriver(ffprofile);
driver.get("http://google.com");
:Run the source the Firefox page open but google.com not opening error
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
reg-app-global","addons":{"fiddlerhook#fiddler2.com":{"descriptor":"C:\\Program Files (x86)\\Fiddler2\\FiddlerHook","mtime":1409222185915,"rdfTime":1406724252000}}},{"name":"app-global","addons":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","mtime":1411627483703,"rdfTime":1411627483531}}},{"name":"app-profile","addons":{"fxdriver#googlecode.com":{"descriptor":"C:\\Users\\RT-13\\AppData\\Local\\Temp\\anonymous3444483664614526613webdriver-profile\\extensions\\fxdriver#googlecode.com","mtime":1411630550698,"rdfTime":1411630550495}}}]
1411630550942 addons.xpi-utils DEBUG Opening XPI database C:\Users\RT-13\AppData\Local\Temp\anonymous3444483664614526613enter code herewebdriver-profile\extensions.json
1411630550943 addons.xpi DEBUG New add-on fxdriver#googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: block`enter code here`list is disabled
1411630551091 addons.xpi-utils DEBUG Make addon app-profile:fxdriver#googlecode.com visible
1411630551094 DeferredSave.extensions.json DEBUG Save changes
1411630551095 DeferredSave.extensions.json DEBUG Save changes
1411630551095 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1411630551098 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1411630551098 DeferredSave.extensions.json DEBUG Save changes
1411630551098 DeferredSave.extensions.json DEBUG Save changes
1411630551098 addons.xpi DEBUG New add-on fiddlerhook#fiddler2.com installed in winreg-app-global
Please downgrade the Firefox version to 31 and add the latest selenium standalone server 2.43 library into the build path. This is a common issue that every one face at least once in a week:)
Solution -
1) Upgrade your Selenium Server i.e. selenium jar "selenium-server-standalone-2.xx.x.JAR" TO "selenium-server-standalone-2.45.0.JAR"
2) Upgrade your Selenium Client Driver i.e. selenium libs folder "selenium-java-2.xx.x" TO "selenium-java-2.45.0"
3) Check and Install compatible version of Firefox
This will RESOLVE your problem.. Cheers !!
Refer - Download updated selenium libs & jar i.e. Version 2.45.0

Didn't find class org.cocos2dx.cpp.AppActivity

Cocos2d-x version 3 problems running Android test application.
I've followed the instructions how to create a new project using the cocos.py script.
This works fine. Then I follow the instructions running build_native.py. Import the Android test application to Eclipse. When I try to run it on a device I get.
05-09 10:54:42.363: E/AndroidRuntime(18170): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mycompany.testAndroid/org.cocos2dx.cpp.AppActivity}: java.lang.ClassNotFoundException: Didn't find class "org.cocos2dx.cpp.AppActivity" on path: DexPathList[[zip file "/data/app/com.mycompany.testAndroid-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.mycompany.testAndroid-1, /vendor/lib, /system/lib]]
Any ideas how to fix this problem?
You application has not org.cocos2dx.cpp.AppActivity class.
Check, that required activity really exists.
For ex. if you proj.android/AndroidManifest.xml contains:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.testAndroid"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
...
<activity android:name=".AppActivity"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|screenSize|smallestScreenSize»>
Then you should have proj.android/src/com/mycompany/testAndroid/AppActivity.java:
package com.mycompany.testAndroid;
import org.cocos2dx.lib.Cocos2dxActivity;
public class AppActivity extends Cocos2dxActivity {
}
Use cocos console. It is quite useful tool.
I will describe example with simple project on linux.
You should have installed ant, python, sdk, ndk, jdk, jre, cocos2dx-3
First - you should create new project. Run in terminal
cocos new TestProject -l cpp -p com.example.test
Open folder with project
cd TestProject
Run project
cocos run -p android
It will run sdk with HelloWorld example