I am new to Appium/Selenium parallel testing and I was wondering if one could run different tests concurrently across multiple devices? My team needs to reduce the total runtime of our UI tests and are not concerned with different OS versions affecting the behaviour of the application for these specific tests. I have been reading through many posts and trying to search for answers but all I can seem to find on the internet are articles, tutorials and forums on how to run the same test in parallel on multiple devices.
Can I run different tests concurrently on multiple devices without kicking off different tests manually, or is that a limitation of Appium? Ideally this would be implemented using an open source solution.
(Right now we are trying to use a JUnit approach for testing due to specific limitations of other tools. All tests are being written in Java.)
Thanks for your time.
Depending on your setup, you can accomplish this. However, a lot of your build automation and device management will need to be set up by you or your team custom, so you will not be able to use an out-of-the-box solution to do this.
I've accomplished the same with both Selenium and Appium -- you will need a test framework that allows for test execution with parameters, and your devices will need to be connected to separate USB hubs that each have their own virtual server attached.
Using NUnit, here's my approach:
Generate .txt files for each different set of tests I want to run -- test_list_1.txt, test_list_2.txt, etc. Each list contains a different group of test cases to run.
Write a build script to clean & build your project from scratch -- for C#, I use Cake.
Set up a job in Jenkins that executes your build script and calls NUnit's console runner, which takes a test_list as a parameter. This initiates a test execution against a list of test cases
You should be able to build your Jenkins job against any test list you want, so you now have the ability to run your automation against different tests, as mentioned in your problem description.
Connect your virtual machines (which connect to your Appium devices) to Jenkins and add them as executors on your job. Now you have multiple machines to run your job against.
With this set up, you can run as many jobs as you have machines -- 4 VM's means 4 jobs, which means you can run 4 different sets of test cases concurrently.
Setting this up on my end was completely custom -- I used certain tools to accomplish individual steps, but it worked for our needs and we did accomplish concurrent execution against different sets of test cases.
What you are asking , basically it's not possible.
You can't run different test cases on different devices.
Though you can run same test cases on wide range of devices using Hive or Browserstack or AWS device farm.
Hope this helps.
You can run your tests locally on multiple devices by creating multiple instances of appium server. Every Appium server should be running on different ip and proxy address. So you should set your capabilities for each instance accordingly.
But there is another solution as well but that's bit costly. That is AWS Device Farm. AWS provides multiple real devices hosted at there servers which you can use for executions of your customised test suits. They give initially 1000 free test minutes. You have to create a maven project for your test scripts. I prefer using testng rather than Junit.
Related
Details -
Can we run the multiple instances of selenium script at same time
while running multiple instances of selenium script at same time my script failed connection refused
AnyOne has the solution for it .
You can try something called Selenium Grid.
Selenium-Grid allows you run your tests on different machines against
different browsers in parallel. That is, running multiple tests at the
same time against different machines running different browsers and
operating systems. Essentially, Selenium-Grid support distributed test
execution. It allows for running your tests in a distributed test
execution environment.
You can find more on the following website= https://www.seleniumhq.org/docs/07_selenium_grid.jsp.
Also, check out this response as well. It was for a similar question= Running multiple Selenium tests at the same time
I can't found any question/answer about that (probably I don't know how to find it...)
Could somebody give me a global idea to execute +200 Selenium webdriver tests (Python) from cloud servers/tools?
Thanks!!
rgzl
Another way is Saucelabs, using this service you'll be able to just send your Selenium
Java/Python tests
to their Cloud infrastructure for execution. The benefits of such testing are obvious – no need to waste time and resources setting up and maintaining your own VM farm, and additionally you can run your test suite in various browsers in parallel. Also no need to share any sensitive data, source code and databases.
As said in this acticle:
Of course inserting this roundtrip across the Internet is not without cost. The penalty of running Selenium tests this way is that they run quite slowly, typically about 3 times slower in my experience. This means that this is not something that individual developers are going to do from their workstations.
To ease the integration of this service into your projects, maybe you'll have to write a some kind of saucelabs-adapter, that will do the necessary SSH tunnel setup/teardown and Selenium configuration, automatically as part of a test.
And for a better visualization:
Here's a global idea:
Use Amazon Web Services.
Using AWS, you can have a setup like this:
1 Selenium Grid. IP: X.X.X.X
100 Selenium nodes connecting to X.X.X.X:4444/wd/register
Each Selenium node has a node config, running 2 maxSessions at once. (depending on size of course)
Have also, a Continuous integration server like Jenkins, run your Python tests Against X.X.X.X grid.
We have several parallel development groups working on different things in separate environments. Each group has a jenkins server/2 windows slaves setup that is executing selenium nunit tests.
Is it possible to to have all the slave instances in a pool that each of the jenkins servers can pick from? We are using the JNLP b/c there are issues with some of the browser tests that require running in an interactive desktop. I thought perhaps I could start a JNLP for each server instance on each machine, but that seemed the wrong way as each server would have no knowledge of other servers use of it. Is there any way to make a slave available to multiple servers?
I don't think you can do what you are looking for.
You can run multiple slaves on one computer, but as you said, there is no way to keep multiple servers from trying to access the same desktop.
A better solution is probably to combine your Jenkins servers. You can use the security settings and views to set it so that regular users are not even aware of the other projects being run in parallel- while allowing one Jenkins server to coordinate all of the builds (which is what you want).
You may want to check with CloudBees Ops Center (http://www.cloudbees.com/joc), in particular, the Share Executors (Slaves) Between Masters feature. That would do exactly what you want, but for a bit of a price.
Background:
We are running all physical
hardware.
All developers are using
VS 2010 Ultimate and we will be using
iTrace files.
We would like to run
our coded UI tests from test manager.
We have multiple test environments:
AT, SIT, FVT, UAT living each on
physical servers.
I’d like to be able to go into test manager select tests and say go run in AT or go run in FVT.
Here’s my question:
Do I set up interactive test agents on all of my test environments and instruct the coded UI tests to hit http://localhost/application?
Do I set up an interactive test agent on a another machine to execute the tests? If so how do I configure the coded UI tests to point to each of the test servers? Do I need test agents running as a process of the web servers?
We are using the following unsupported Microsoft features: http://blogs.msdn.com/b/lab_management/archive/2011/02/15/running-build-deploy-test-workflow-on-physical-environments.aspx
Actually, the blog describes exacly what you need and we got it up and running within a day like described, in a VMWare lab, without having the Lab Management pre-requisites deployed.
My company monitors performance and availability of websites and mobile applications via functional testing in the cloud; we're looking to expand our technology to include Selenium tests. We use RoR systems to remotely run our functional tests intermittently from a number locations save the data in mysql for reporting/alerting purposes.
We anticipate including Selenium RC on each of our monitoring servers to execute remote tests. We may evolve to running tests from multiple machines in each location (i.e. different flavors of OS, or for scalability purposes).
Since we already have a controller for managing the runs of our tests in various locations, so would Grid would be overkill or a necessity?
Any other suggestions?
Well, the Grid does not actually manage (as in schedule) the different runs of tests, it is just a collection of Remote Controls (RCs) connected to a Hub which distributes the tests amongst the machines running the different RCs when their execution is requested.
As for scalability, if you mean stress load testing, then I suggest a different tool (something like JMeter), it could be done with Selenium but it'd require a great number of RCs connecting to the same server which could probably require several machines running many RCs each. RCs are kinda resource heavy if you need many of them (you will for stress testing).
Running different OSs and browsers from various locations should be no problem though, as long as you specify relevant profiles for each, I'd say that this would be the best/main use for Selenium (other than regression testing during development).
Overall, I'd say it's worth it to put up a Grid and RCs in each of your servers, though you can probably manage using a single hub (and thus a single Grid) and having all RCs connect to it.