-
-
Notifications
You must be signed in to change notification settings - Fork 764
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
#147 Fix. The Appium node silent starting #240
Conversation
@Jonahss <developer>
<email>tichomirovsergey@gmail.com</email>
<name>Sergey Tikhomirov</name>
<url>https://github.com/TikhomirovSergey</url>
<id>TikhomirovSergey</id>
</developer> ? :) |
These features send server output to an IDE console also. |
Oh wow this IS the bomb, way to go. I'm liking it. I'm glad you included good exceptions for if appium or Nodejs aren't installed. @simonk how's it look to you? |
System.setProperty(AppiumServiceBuilder.APPIUM_NODE_PROPERTY, definedNode); | ||
AppiumDriverLocalService.buildService(new AppiumServiceBuilder().withIPAddress("127.0.0.1"). | ||
usingPort(4000).withArgument(GeneralServerFlag.TEMP_DIRECTORY, | ||
"C:/Windows/Temp")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test going to pass on non-windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is passees on Mac OS X. But I'll remove this in order to avoid the confusion.
This PR is cool 👍 If I understand correctly, java-client is now able to programmatically start the appium node server. |
} | ||
catch (Throwable e){ | ||
destroyProcess(); | ||
throw new AppiumServerHasNotBeenStartedLocallyException("An unexpected throwable has been caught!", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it'd be more concise like this?
throw new ServerNotStartedException("The local appium server has not been started.");
The message An unexpected throwable has been caught!
isn't very useful to an end user.
Thanks @bootstraponline for remarks. I'll make improvements as sson as possible.
Yep! You are exactly right! |
@bootstraponline @Jonahss Improvements were done. I added custom_node_path.properties. Here are paths to appium.js installed with Appium desktop application. They are needed for 2-4 tests. Make sure that Appium desktop application is installed on your environment |
👍 |
#147 Fix. The Appium node silent starting
@TikhomirovSergey i tried running appium-server programmatically from java_client(3.2.0),node version(v0.12.7), i get the below error io.appium.java_client.service.local.InvalidNodeJSInstance: Node.js is not installed |
@saikrishna321 Sergey is on vacation for the next week or two. You can take a look at the source and try to see whats going wrong with your setup. |
Hi, I am getting the following error ,when trying to do so module.js:340 |
Tried with : Seeing Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. // ########### Initialization in Script was |
@muralidhar1620 ...first try the default one and see what you are getting |
@muralidhar1620 ...for me this piece of code is working service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingDriverExecutable(new File("C:/Program Files/nodejs/node.exe")).withAppiumJS(new File("D:/appium/Appium/node_modules/appium/bin/appium.js"))); |
@muralidhar1620 ...you have to give path of appium.js not appium.exe.....and another thing in capabilities section give this: Not this: this gives error what you are getting |
@prachi02 Tried mentioned steps and i am seeing Error Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/validator/routines/InetAddressValidator |
@muralidhar1620 ....paste your entire code which you are using |
Thanks @prachi02 for Reply .selenium 2.47.1 and java client 3.2.0 exists but not common validators 1.41 code import java.io.File; import org.openqa.selenium.By; public class PerkTVDriverScript {
} |
@prachi02 Also node.js is installedin windows and i am able to launch appium server from that manually.Thanks! |
@muralidhar1620 ...no problem.... |
@prachi02 Did you got the issue ?.Can you please paste all working code and its dependencies.Thanks! |
In this section of code /AppiumDriverLocalService service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingDriverExecutable(new File("C:/Program Files/nodejs/node.exe")).withAppiumJS(new File("E:/AppiumForWindows-1.3.4.1/Appium/node_modules/appium/bin/appium.js")));
Uncomment till service.start() and comment second last line like AppiumDriverLocalService service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingDriverExecutable(new File("C:/Program Files/nodejs/node.exe")).withAppiumJS(new File("E:/AppiumForWindows-1.3.4.1/Appium/node_modules/appium/bin/appium.js"))); Try the above code |
@prachi02 I tried with mentioned code before and now and i am facing with same issue Can connect to my machine Remotely(Teamviewer) and check please Email id : muralidhar230@gmail.com |
@muralidhar1620 ...are you remotely login??..... |
I just tried the new 3.2 and the appium server works absolutely fine without any issues. I have recorded a tutorial on the same if anyone needs step by step information can go through the youtube video from below link: Thanks, |
@w2a i was able to start the appium by below code appiumDriverLocalService = AppiumDriverLocalService But i have an issue, it says adb could not be located in tools and platform-tools.. I have my ANDROID_HOME set in both .bash_profile and .zshrc profile .. 1.when i run my tests form commandline it works. But when i start the test programmatically appium throws error. Find the below logs 2015-09-25 10:38:23:222 - info: Welcome to Appium v1.4.11 (REV 8cf8311f00e59a2b10fde1834fcf6d5ace6fbcd0) |
do you have the androidStudio installed at this location: /Users/saikrisv/Library/Android/sdk/platform-tools and same you have given in the .bash_profile The issue is related to the path variables not configure properly or have you ever installed Android SDK prior to installing the latest one that you are working on? Thanks, |
export ANDROID_HOME=/Users/saikrisv/Library/Android/sdk when i do "adb devices" from terminal, i can see devices..... |
Hi All, Awesome work!! Cheers, |
Hi guys!
It doesn't work because a path to node.js is not defined in your PATH environment variable. Why? I don't know. Please check it. Here is the example for Win: The same works fine on MAC OS X (I've checked it)/Linux if you download and install Node.js from: https://node js.org. Also the installation process should define the path to the instance in your PATH variable if everything is going properly. Otherwise please open a new issue here: |
Here are samples with usuful comments |
can some one post command to start this service on mac Regards, |
This is just fantastic! |
my question was how different the arguments for the code will be on mac? as i have installed and using Appium.app 1.4.13 |
@VenkateshPS There would b not different in code for mac.. All you need is appium installed from node. |
HI @saikrishna321 and @w2a , Below is my code: package abc; import java.io.File; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.AppiumDriver; public class NewTest {
} I got the below error when I run the above code. Could you please help me to get rid of this. [TestNG] Running: �[36minfo�[39m: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)
Default suite Total tests run: 1, Failures: 1, Skips: 0[TestNG] Time taken by org.testng.reporters.EmailableReporter2@c46bcd4: 37 ms |
@shivakrishnach31 look at the code below
|
Guys |
Hi, one of the server arguments is .withIPAdress() - what would be a scenario where I would change the IP address of the Appium server ? Not sure if I got this right... |
Change list is below:
Requirements
Warning (!!!) Node.js versions which lower than 0.12 are deprecated for Appium server >=1.4.10
Which capabilities these features provide
Proposed features provide abilities and options of the starting of a local Appium node server. End users still able to open apps as usual
when the server has been working locally\remotely. Now they are free to launch a local Appium node server and open their app for the further testing the following way:
How to prepare the local service before the starting
If there is no specific parameters then
If there should be non default parameters specified then
or
Lists of available server side flags are here:
Which parameters also can be defined
or
Some more detailes about this use case. The node server instance which has been installed via npm is supposed to be used by default. This instance can be overridden if an end user defines the "appium.node.path" system property any available way.
Externally defined file path or file path defined at system properties should contain a full path to the appium.js file (!). These server instances should have the proper structure.
How to create an AppiumDriver instance
The common constructor is still available
There are new constructors:
An instance of AppiumDriverLocalService which has passed through constructors will be stopped when
If there is need to keep the service alive during a long time then something like that is available