I want to make a Test Lab setup for Appium - ios

I want to make a Test Automation Lab for Appium (Android & iOS)
Questions:
1. As per Appium limitation we can access Single device (ios) from Machine.
In this case If I connect multiple Ios/Android devices to MAC machine (Server) how I can access from other machine ?
If I make Windows machine as a server Can I access and Run scripts from MAC machine?

You can use the selenium grid with Appium to do that. parallel test with appium & selenium grid
you have to add the appium in environment variable
start the grid
start the node which you want then run in parallel

You can go for sauce labs, Sauce Labs allows users to run tests in the cloud on more than 500 different browser platform, operating system and device combinations, providing a comprehensive test infrastructure for automated and manual testing of desktop and mobile applications using Selenium, Appium and JavaScript unit testing frameworks.
https://saucelabs.com/

Related

Is it possible to run webdriverio app tests against AWS Device Farm without uploading the test suite?

We currently have a suite of webdriverio/appium tests for our react native app, with separate wdio.conf files for local, simulator, BrowserStack etc.
All of the examples I can find for device farm either involve first uploading the test suite as a zip up front, or creating a custom test runner that obtains a selenium grid url from Device Farm and then triggers the wdio command (but I can only see this being used for Selenium, nothing for appium/app testing).
Is it not possible to run tests from my local machine whilst pointing to AWS Device Farm devices?
Unfortunately this is not possible with AWS Device Farm, as you have already noticed that they do not have a Selenium Grid for mobile devices. In general for me it has been a huge hassle to get Appium tests to work on AWS using CI/CD - both because of the setup and the inability to easily debug since I can't run the tests locally against their devices. I would advise using another cloud farm service like Browserstack which allows you to target their grid from your local machine

I am using appium.app on mac how to open more than one session to run with different ports

I want to run the appium with different ports i am using appium.app on mac desktop.how to run with different ports any ideas..?
What do you mean to run appium with different ports? In case you're using the app, you set the port before you start the server.
In case you meant to run multiple appium sessions with different ports, I've installed appium using npm and then started my servers from command line
I guess you are talking about attaching more than one device and then executing the scripts in parallel on all devices like the selenium grid.
You can go through this link, which is appum's official documentation for setting up selenium grid for mobile automation.

Running appium scripts for ios in parallel

I have two mac machines with all the setup installed for appium. I want to run the appium scripts on two ios simulators in parallel.It is not possible in one mac machine by launching two simulators in parallel because mac uses only one instrument instance at a time.
Is there any way to approach this by using two machines?
Thanks.
For android you can run two emulators in parallel, So u can establish two appium sessions and run the scripts in parallel.But coming to ios xcode won't allow you to run the simulators in parallel.
You could use the Selenium grid to handle your two machines, as instructed at https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/grid.md
Otherwise you'll need to create a driver session against each of the servers in your script. To target a specific Appium server, simply change the url:port combination to match either of your servers when creating the Appium webdriver object/session.
As of now,
http://appium.io/docs/en/advanced-concepts/parallel-tests/
"With Xcode9 Appium supports parallel RealDevice and Simulator testing." for iOS

Opening multiple appium server Instances on same machine

Can I start 2 appium server instances on my machine at the same time so that I can execute my test script simultaneously on 2 different devices connected to the machine?
Actually what I'm trying is to run my test script on 2 devices connected to same windows machine. For this I am using TestNG to pass the Android Driver url to start session. This url will be dynamic as 2 devices will be using 2 Appium server instances. Can I create 2 instances of Appium server at same time? If so then can I use code to create those instances as I don't want to use GUI to start it.
This question has already been asked and answer (if I am reading what you want correctly).
Please refer to How to start the Appium server from command prompt in MAC machine?
On a windows machine there should be an appium executable which you run with the command line arguments --address 127.0.0.1 -p 4273
In essence all you need to do is use a different port for your tests.

Using Selenium with ios-driver to test iOS mobile apps from a Windows machine

I am investigating the feasibility of testing native, hybrid, and web-based applications using Selenium for Windows (web only), Android, and iOS mobile devices (e.g. iPad).
The ideal setup for a tester would be a Windows machine with physical devices connected via USB. This works with Android as all that is needed (excluding the ADK and USB driver setup) is Selendroid's stand-alone server and a JAR dependency. However, from my understanding, this is not possible with iOS mobile devices using ios-driver. I have also checked out Appium, and they too state that a Mac computer would be needed to test iOS devices.
So that brings us to my question: Is there a way to test iOS mobile apps (web, hybrid, native) from a Windows machine?
Here is a list of preferences:
- Use Selenium and other Selenium-compatible plug-ins
- Run tests from Windows machine
- Cannot use iOS VM
- Cannot use Mac machine with "middle-man" application to communicate with Windows machine
- Have to test physical mobile devices
- No "hacks" (e.g. Jailbreaking)
It is also safe to assume that I have no experience developing iOS applications.
It is possible to run the tests from a Windows machine but not the way you are probably thinking. You will still need a Mac. Here are the requirements:
A mac on your network with Appium server running
Has Appium environment installed properly
Has the .app on the machine
If you have these three requirements fulfilled and there is no firewall blocking network access to the Mac then you can do it. You will have to actual tests on the Windows machine but instead of specifying 127.0.0.1:8080 in the setup method as the IP address of Appium server you will replace it with this: yourmacsipaddress:8080 and this should execute the test properly.
Remember that you have to specify the path of the .app in the test which is running from your Windows machine. But the catch is that the path has to be the path of the .app in the Mac and not on your Windows machine.
So the tests will run from your Windows machine but the installation of the app, the automation, and the testing will be done on the Mac but you will get the "pass" or "fail" update on your Windows machine.
If you do not want to set up appium in your local machine, You can also go with sauce lab.
sauce lab provide vm to you. select appropriate device and run using appiumDriver. Provide below capabilty and run using appiumDriver. your remote url will be like this
http://your_username:your_access_key#ondemand.saucelabs.com:80/wd/hub
For iOS Native,
{"driver.class":"io.appium.java_client.ios.IOSDriver","platformName":"iOS","browserName":"","platformVersion":"your os version","deviceName":"device Name","appiumVersion":"1.5.3","app":"sauce-storage:Your application name on sauce storage"}
Your application should be available on sauce storage. You can upload using sauce api .
You can also use this same for web application, android/ ios native application.

Resources