Running appium remotely (A great Challenge)

2,031 views
Skip to first unread message

Rameshwar Juptimath

unread,
Apr 30, 2014, 3:28:08 AM4/30/14
to appium-...@googlegroups.com
I have a scenario. 

I want to run tests on a machine that has windows operating system and the device on which the test are to be conducted  will be connected to a Mac machine.

The test scripts should be mapped to the mac which will have an apple device connected to run the tests.

EX:

I have machine say "Bill" who has windows operating system. 
One more machine named "Steve" who has Mac OS X running.

Bill will have the selenium commands. 
Bill will not have any appium server running on him. 

But Steve will have appium server running on him. Bill and Steve are connected to each other via LAN. 

Bill will create a remoteWebDriver and send the commands to Steve who will be having any apple mobile device connected. 

Steve should take the Selenese commands from Bill and execute them using appium on a mobile device.

Is this possible?

Patrick L

unread,
Apr 30, 2014, 1:51:10 PM4/30/14
to appium-...@googlegroups.com
Why can't you just run appium on the machine with the device and run the tests on there?
I'm using jenkins and it works great. 1 machine to do the builds, my machine to write/debug tests.
Jenkins also lets you connect machines together so you can trigger builds remotely if thats what you are looking for

Isaac Murchie

unread,
Apr 30, 2014, 2:10:12 PM4/30/14
to Rameshwar Juptimath, appium-...@googlegroups.com
You can just change the command executor for the tests.

Where you would use something like self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) change `localhost` to the address of the machine running the Appium server.

In the tests on "Bill", use
self.driver = webdriver.Remote('http://address_of_steve:4723/wd/hub', desired_caps)

Cheers,
Isaac.


--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

Rameshwar Juptimath

unread,
Apr 30, 2014, 2:12:03 PM4/30/14
to appium-...@googlegroups.com
Thanks for the reply Patrick. Im planning to use Jenkins for reporting.

And the reason I can't run appium on same machine coz I need to write tests on Visual Studio which will not work on MAC. I could use Xamarin on MAC but client requirement is Visual Studio.

Anyways I got the solution.
I should just start appium on MAC with appium ip address as 0.0.0.0 (Which is default) and port 4723.

Then I should use the ip address of the MAC machine on the Windows machine while creating the driver.

like if MAC ip is : 192.162.0.25

my driver creation statement would be:

driver=new RemoteWebDriver(new URI("http://192.162.0.25:4724/wb/hub")), capabilities);

And it is obvious that both Mac and windows machine should be connected via LAN.
Message has been deleted

Naveen Kumar

unread,
Jun 4, 2014, 11:29:17 AM6/4/14
to appium-...@googlegroups.com
I tried this for two window machines

Machine A:
          Has Appium running and android device connected

Machine B:
          Has selenium code which has to executed on machine A by code:
          driver = new RemoteWebDriver(new URL("http://<Machine A IP>:4723/wd/hub"), capabilities);

However, I am getting below error:

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.
Build info: version: '2.42.0', revision: '5e824302019c86eae9c8c3ca9155e7307b410cf8', time: '2014-05-24 09:48:41'
System info: host: 'FH3XGZ1', ip: '10.4.3.38', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_51'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:590)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:127)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
at com.saucelabs.appium.RemoteAndroidChromeTest.setUp(RemoteAndroidChromeTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 10.4.5.242:4723 [/10.4.5.242] failed: Connection timed out: connect
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:140)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:204)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:173)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569)
... 28 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:117)
... 40 more

java.lang.NullPointerException
at com.saucelabs.appium.RemoteAndroidChromeTest.tearDown(RemoteAndroidChromeTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Reply all
Reply to author
Forward
0 new messages