Selenium Grid hub/node parallel execution remotely

I need help on running test cases from Selenium Grid server machine running as a hub with the devices connected to the node and here’s what I have:

I have a iMac running Mavericks (10.9.5) running Selenium Grid server as a hub. I also have a MacBook Air (running on Mavericks) running Selenium Grid as a node. Appium is running from terminal on port 5000 with --uuid parameter pointing to my iOS device connected to the node.

What works:

If the test cases are on the node, I’m able to run 2 devices parallely from the node and the node is pointing to the Selenium Gid hub on the iMac.

What I wanted to achieve: (for troubleshooting, I’m only connected to one iOS device on the node).

I would like to have the test cases on the hub machine and this will give me a benefit of having the test scripts in one single location rather than duplicating on each of the nodes. I changed the DesiredCapabilities to point to the node and when I try to instantiate a new IOSDriver, I’m getting a “Session not created error: Bad app: Unable to locate the app”. The app is located on the server hub and the path is all correct as I verified from the command line on the server with the stat command and it returns back the .app file. The following is the code:

app = /Volumes/Server/Apps/iOS/SampleApp.app (the sample app is lying on the server from where the following code is running:
File appPath = new File(app);
capabilities.setCapability(“app”, appPath.getAbsolutePath());
IOSDriver iOSDriver= new IOSDriver (new URL(http://nodeipaddress:5000), capabilities);
The code is throwing exception on the last line when it is trying to instantiate a new IOSDriver.

But, the same code works when run from the node as shown below. Also, the SampleApp.app is lying on the node.
app = /Volumes/Node/Apps/iOS/SampleApp.app
File appPath = new File(app);
capabilities.setCapability(“app”, appPath.getAbsolutePath());
IOSDriver iOSDriver= new IOSDriver (new URL(http://hubipaddress:4444), capabilities);

I tried the following:

  1. changed from getAbsolutePath to getCanonicalPath() and it fails with the same error
  2. Changed the path to System.getProperty(“user.dir”) + "…/…/Node/Apps/iOS and this doesn’t work too.

Ideally, I wanted to keep the test cases in one location and remote execute on the devices connected to the node. Please help.

Thanks.