groupon / Selenium-Grid-Extras

Simplify the management of the Selenium Grid Nodes and stabilize said nodes by cleaning up the test environment after the build has been completed
BSD 3-Clause "New" or "Revised" License
536 stars 209 forks source link

appium node didn't start after start_grid_extras.sh execution #218

Open Gordiievskyi opened 8 years ago

Gordiievskyi commented 8 years ago

Hi guys,

First want to thanks for the a great job. I am new to grid extras so not sure if it's realy issue. Platform Mac 10.11.4 extras SeleniumGridExtras-1.11.8-SNAPSHOT-jar-with-dependencies.jar(hub and nodes) I am using appium 1.5. Build it from sourse. Command to start it is: node ~/Documents/Appium

When I strat your jar and answer the questions (positiv answer for browser safari and Appium iPhone/iPad/safari). I see created start_grid_extras.sh and appium_node_4723.json(where I see start command node ~/Documents/Appium). When I run start_grid_extras.sh only regular nodes appears under selenium grid(regular I mean Safari browser). If I run it manually like node ~/Documents/Appium --nodeconfig "path/to/appium_node_4723.json" it appears under the grid. Is it ok ? I thought extras.sh should start appium node as well.

Second issue:

When I am running tests using Appium simulator safari(mobile web simulator) two configs for iPhon and iPad are redundunt cuase when I set browserName to iPhone or iPad appium throws error that browser name is not in the list. the only acceptable browsername is Safari

Let me know if you need more details.

BR, Slava

rgonalo commented 8 years ago

Hi @Gordiievskyi ,

Yes, extras.sh should start Appium node. Probably you have one these errors in grid_extras.log file: Cannot find module ... Cannot run program ..., No such file or directory

The problem is that Appium start command should be an absolut path, don't use ~/.

About the second issue, Appium uses browserName to launch browser in mobile and only accepts safari, chrome, chromium and browser. So browserName capability can not be used to select appium grid node. You should use platform, version or applicationName capabilities.

Gordiievskyi commented 8 years ago

that's Appium official site saying that for simulator browserName = "Safari" "https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/mobile-web.md

If I run appium wothout extras using config created by extras, with such change "safari" => "Safari" then I can run simuntaniously safari browser and safari in simulator. Currently extras won't start is I change "safari" => "Safari". It saya "Safari" is not in the list

rgonalo commented 8 years ago

In Appium you can use 'safari' or 'Safari', but Selenium-Grid-Extras and SeleniumGrid only work with 'safari'. So if you use 'safari', it should work.

Gordiievskyi commented 8 years ago

I start appium node that connects to grid extras hub with 'Safari' as browser name. Also if I use 'safari' for appium node and 'safari' for webdriver node then tests alweys run as webdriver. Both nodes are run on the same pc.

Bottom line: case 1 - two nodes on the same mac connected to the same grid extras hub: appium(browser name 'Safari' and started without start_grid_extras.sh) and webdriver node (browser name 'safari' started using start_grid_extras.sh) two tests can run simulteniously on 1 pc(1 in simulator 1 in desctop safari)

case 2 - two nodes on the same mac connected to the same grid extras hub: appium (browser name 'safari') and webdriver node (browser name 'safari'). Both started using start_grid_extras.sh - every tests that have cap browserName 'safari' will be run on desctop safari

case 3 two nodes on the same mac connected to the same grid extras hub: appium (browser name 'Safari') and webdriver node (browser name 'safari'). Both started using start_grid_extras.sh - appium won't start cause 'Safari' is not in the list of supported browsers

It seems issue is not in the grid or grid extras

Gordiievskyi commented 8 years ago

appium_node_4723.json

{ "capabilities": [ { "seleniumProtocol": "WebDriver", "browserName": "Safari", "maxInstances": 1, "version": "9.3", "platformName": "iOS", "platform": "MAC" } ], "configuration": { "proxy": "com.groupon.seleniumgridextras.grid.proxies.SetupTeardownProxy", "maxSession": 1, "port": 4723, "register": true, "unregisterIfStillDownAfter": 10000, "hubPort": 4444, "hubHost": "HUB_IP", "host": "NODE_IP", "url": "http://NODE_IP:4723/wd/hub", "registerCycle": 5000, "nodeStatusCheckTimeout": 10000, "appiumStartCommand": "node /Users/RGP-ODC/Documents/appium-1.5.1/", "downPollingLimit": 5 } }

node_5555.json

{ "capabilities": [ { "seleniumProtocol": "WebDriver", "browserName": "chrome", "maxInstances": 3, "version": "50", "platform": "OS X 10.11" }, { "seleniumProtocol": "WebDriver", "browserName": "safari", "maxInstances": 3, "version": "9", "platform": "OS X 10.11" } ], "configuration": { "proxy": "com.groupon.seleniumgridextras.grid.proxies.SetupTeardownProxy", "maxSession": 3, "port": 4446, "register": true, "unregisterIfStillDownAfter": 10000, "hubPort": 4444, "hubHost": "HUB_IP", "nodeStatusCheckTimeout": 10000, "downPollingLimit": 0 } }

start_grid_extras.sh

!/bin/bash

/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/bin/java -jar /Users/RGP-ODC/Documents/gridExtras/SeleniumGridExtras-1.11.8-SNAPSHOT-jar-with-dependencies.jar

rgonalo commented 8 years ago

I think the most common use is 'case 2': appium (browser name 'safari') and webdriver node (browser name 'safari'), but tests must have two capabilities: browserName 'safari' and version '9.3' or '9' to choose between mobile and desktop execution. Another option is to use platform capability: browserName 'safari' and platform 'Mac' or 'OS X 10.11'.

Gordiievskyi commented 8 years ago

version won't help for some reason - those capabilities files I used for case 1,2,3(the only thing I've changed was browserName). As you see Appium node and node_5555 has different version(9.3 and 9). Results for cases were described(it seems extras or grid it self do not care about it. Only browserName has metter).