Execute Parallelly two different automation script in two diffrent geny motion instances - robotium

I have developed robotium automation script and its running sequentially in single genymotion instance
I want execute Parallelly two different automation script in two diffrent geny motion instances simultaneously
After opened two genymotion instance , i did ...
adb devices
List of devices attached
192.168.56.103:5555 device
192.168.56.101:5555 device
I have opened one terminal and exported : export ANDROID_SERIAL=192.168.56.101:5555 , one instance of geny motion
I have opened other terminal and exported other instances ANDROID_SERIAL=192.168.56.103:5555
I have executed the different script in corresponding terminal window but genymotion is not running different script in different instance , its running same script in two instance and generated the report .
Please let me know I want to run two different robotim automation script paralley in genymotion ?
Expecting you idea and solution !
Thanks ,
Muthu Selvan SR

So there are couple parts to this question as far as i can see. It seems like you have the first part sorted which is to have two devices connected to your machine and it seems like you can connect to them via ADB.
The next part is to be able to tell the devices to run the tests, it seems like whatever command you are using (if you could post that it might help) is telling it to run the same tests. Sadly there is no way to auto paraallelise the tests across the two devices so you will have to manually determine the sets of tests to send to each device which can be done in a number of ways.
If you look at the documentation here you can see that there are many ways to filter what tests should be run. What you will want to do is find a way to halve them approximately equal between the two emulators so that you get the desired results. I give an example of doing something like this over at this question

You can create a BAT file (Windows) or shell script .sh (UNIX, MAC) which will contain something like the following:
adb -s <serial1> shell am instrument -w <package.test>/android.test.InstrumentationTestRunner&
adb -s <serial2> shell am instrument -w <package.test>/android.test.InstrumentationTestRunner
And run your tests. This will run your test on both the devices at the same time.

Related

Is it possible to reserve a GitLab runner for all jobs/stages of a pipeline?

I'm using GitLab pipelines to run e2e tests on various physical machines (these machines are connected to the test hardware in a 1 to 1 relation). On each machine, a GitLab runner is installed. The pipeline consists of three major parts:
prepare the test hardware (deploy, configure)
execute the e2e tests (on the test hardware)
clean up the test hardware
Currently I'm doing all of this in one job, by using the before_script, script and after_script keywords. But I would like to use multiple jobs (or even stages) for this.
The problem I'm facing is, that I can't be sure that all jobs/stages are executed on the same runner. So it might happen, that the prepare step is executed on runner1 and the execute step is executed on runner2 (even in parallel), which obviously is not what I want. The preparation is more than just creating artifacts, therefore I can't simply give it to the next job.
Tags also seems not to solve this, because a tag can only be specified for one job, not for multiple, or the complete stage.
I understand that this is not the way how runners are used normally, but I still wonder if there is a way to achieve this.
Or can someone point out another approach to solve this?
I'm using GitLab Community Edition 14.3.2.
I think you have two options here for how you can split this up -
As sytech mentioned, you can tag each machine with machine-1, machine-2, etc, which will allow you to make your jobs sticky to each runner. Since you can use variables in runner tags, you could have a job at the start that checks which runner is not running tests, and sets RUNNER_TAG or something similar to that runner, so you don't have to hardcode your runner to a single box
You could not have the test boxes run the jobs directly (presumably you're using a shell runner to do this today), and use SSH or winRM to access the box directly, and modify it from there. Then the state of your runner doesn't matter at all. This is likely the "cleaner" way to do it, so your test boxes don't have to share resources or state with the runner

Run the same test case on multiple devices in detox

I would like to achieve running one example test case for multiple devices in parallel. I see that in doc there is an information about maxworkers. I add in detox config new device like 3 times add type of device and increase the number of workers to 3. Unfortunately it works only on one device. Any ideas, tips what should i do to make running tests on multiple devices in parallel? I need to run test cases for 7 emulators/devices to make sure that everything works correctly.

How to run multiple test classes with a single command?

I've started digging about how to run integration tests with Flutter and the pro/cons it has.
Besides that the test output sometimes isn't helpful at all, I'd like to know if there's a way to run multiple dart classes with a single command.
Let's put an example where I've in my test_driver folder 4 classes:
login.dart
login_test.dart
register.dart
register_test.dart
In order to execute the tests on one of them, I'd do:
flutter drive --target=test_driver/login.dart
Is there any way where I can avoid doing
flutter drive --target=test_driver/login.dart
flutter drive --target=test_driver/register.dart
A posible workaround I've in mind is create a bash script to get all the files that doesn't end with "_test.dart" and execute that command.
Thanks!

Run selected test cases in Squish for BDD design

Squish is an UI automation tool. Here I wanted to apply filters to select test cases. Or execute test cases need a condition to be run.
Squish offers few ways to run test cases from command line and have some control over them.
To run a test suite from command line:
squishrunner --testsuite /home/MyProject/suite_UI
2.To run a particular test case/cases:
squishrunner --testsuite /home/reggie/suite_addressbook [--testcase test_case_name]*
To run a particular scenario (Usage of tags)
Here you need to do some work. Let's say you want to categorise your tests between smoke test and Full Regression.
So you can use tags on top of scenarios. It quite easy.
Example:
#smoke
Scenario: To connect to the device, start the emulator
Given I am in the Start Screen
When I Click on Manual connection option
Then I should be able to connect to the device
#FullRegression
Scenario: To connect to the using using Manual connection option with connection type as Ethernet Only
Given Start Screen
When I Click on Manual connection option for Ethernet Connection
Then I should be able to connect to the sensor for Ethernet Only connection
To run all 'smoke' tags from a particular test case,
--testcase "tst_com_device_ManualConnect" --tags #smoke
Skipping tests
You can skip one or many test cases,
----skip-testcase "tst_com_device_ManualConnect" --tags #smoke
All except the ones with #smoke tag will be run.

Can you run two test cases simultaneously in a Test Suite in Microsoft Test Manager 2010?

I am trying to create a unit test to run on two machines in Microsoft Test Manager 2010. In this test I want some client and server side test code to run simultaneously; the client side test being dependent on server side test working successfully.
When putting together a Test Suite in Test Manager, I want to be able to set both tests to have the same order value (so they run at the same time) but the validation prevents this; setting the order as shown below:
Is there any way I can achieve the simultaneous test execution I am after?
Sorry for the late answer... I've missed the notification about your answers to my question :-( Sorry for that!
In case you are still looking for solution, here my suggestion.
I suppose you have a test environment consisting of two machines (for server and client).
If so, you will not be able to run tests on both of them, or better to say you will not have enough control over running tests. Check How to Run automated tests on multiple computers at the same time
Actually I posted a related question to "Visual Studio Development Forum", you could check the answers I got here: Is it possible to run test on several virtual machines, which belong to the same environment, using build-deploy-test workflow
That all means you will end up creating two environments each consisting of one machine (one for server and one for client).
But then you will not be able to reference both environment in your build definition it you can only select one environment in DefaultLabTemplate.
That leads to the solution I can suggest:
Create two lab environments
Create three build definitions
the first one will only build your test code
the second one will deploy last successful build from the first one and start tests on the server environment
the third one will deploy last successful build from the first one and start tests on the client environment.
Run the first build definition automatically at night
Trigger the latter two simultaneously later.
It's not really nice, I know...
You will have to synchronize the build definition building the test code with the two build definitions running the tests.
I was thinking about setting up similar tests some months ago and it was the best solution I came up with...
Another option I have not tried yet could be:
Use a single test environment consisting of two machines and use different roles for them (server and client respectively).
In MTM create two Test Settings (one for the server role and one for the client role).
Create a bat file starting tests using tcm.exe tool (see How to: Run Automated Tests from the Command Line Using Tcm for more details).
You will need two tcm.exe calls, one for each Test Settings you have created.
Since a tcm.exe call just queues a test run an returns (more or less) immediately this bath file will start tests (more or less) simultaneously.
Create a build definition using DefaultLabTemplate.
This definition will:
build test code
deploy them to both machines in your environment
run your bath script as the last deployment step
(you will have to make sure this script is located on the build machine or deploy it there or make it accessible from the build machine)
As I've said, I have not tried it yet.
The disadvantage of this approach will be that you will not see the test part in the build log since the tests will not be started by means provided by DefaultLabTemplate. So the build will not fail when tests fail.
But you will still be able to see test outcomes in MTM and will have test results for each machine.
But depending on what is more important to you (having rest results or having build definition that fails if tests fail or having both) it could be a solution for you.
Yes, you can with modified TestSettings file.
http://blogs.msdn.com/b/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx