Running Appium as a node - platform parameter

Hello,
I am setting up an Appium instance to join as a node on our existing Selenium grid. I use node_config.json file and one of the parameters supplied is ‘platform.’ In the documentation and all I could find online this should be “MAC” to run a test on a mobile iOS device. However, when I try to run a test and pass ‘MAC’ as a platform I get an error in Appium stating it’s not supported platform, ‘Android’, ‘iOS’ or ‘Firefox??’ are the only ones supported. However, when I set it to ‘iOS’ even though the node joins the grid successfully and I can execute the scripts, grid console shows a 500 error: HTTP ERROR: 500 Problem accessing /grid/console. Reason: java.lang.IllegalArgumentException: No enum constant org.openqa.selenium.Platform.iOS

How can I resolve it? Has anyone figured it out?

Hi :slightly_smiling:

I had the same issue, and tracked it down to the platform having to be “mac”, and not “iOS”. That is, in my Appium node config, I have:

{ "capabilities": [ { "browserName" : "safari", "maxInstances" : 1, "platform" : "mac", "platformName" : "iOS", "platformVersion" : "8.1", "deviceName" : "iPhone 4s" } ], "configuration": { "cleanUpCycle" : 2000, "timeout" : 300000, "browserTimeout" : 60000, "hub" : "http://127.0.0.1:4444/grid/register", "maxSession" : 1, "host" : "127.0.0.1", "port" : 47000, "hubPort" : 4444, "hubHost" : "127.0.0.1", "url" : "http://127.0.0.1:47000/wd/hub", "register" : true, "registerCycle" : 5000, "role" : "node" } }

This will make the grid console load without errors. Just remember, you have to update your web driver to boot — here’s mine (node.js wd):

{ browserName : 'safari', deviceName : 'iPhone 4s', platformVersion : '8.1', platform : 'mac', platformName : 'iOS' }

Thank you, Daniel. Where can I find the web driver configuration file (node.js). Is it on the server where your appium is running or on the host where the grid hub runs?

No problem :slight_smile:

Well, I’m using the command-line version of Appium (installed through NPM), so that’s how I configure it — I wrote it myself. I start Appium in the shell with appium --nodeconfig ios-node.json --port 47001 — where ios-node.json contains what I quoted above.

I guess if you’re using the GUI version, you’ll just have to put in “mac” as platform where you have “iOS” now? Not sure :slight_smile:

HTH

Thanks, Daniel. What I actually had to do was to modify my framework to accept another argument (PlatformName). It was only using Platform and it would not accept mac alone for it, as it would complain it’s not supported (iOS was expected). But with your help and example I was able to figure it out.
Btw, I can specify the appium node config within gui (it’s under General Settings --> Selenium Grid Configuration File) if you ever want to go that route :wink: