We are running Automation scripts for Mobile devices with Android, and IOS.
We are trying to run two feature files for two Android devices(One Plus and Samsung S10).
Initially scripts are ran on both the devices but when the first Feature file execution is stopped then automatically the execution process on Second device also stopped.
Appium version - 1.16.0
We tried changing the order of the devices also like Running Feature file of Samsung s10 first and One Plus later and changed by initiating the execution of feature file of OnePlus device first and Samsung S10 next.
In both the cases the same happened when execution of first initiated is ended the other process is stopped suddenly without any error
We are retrieving the capabilities of the devices from database.
Running these scripts on Mac machine
I suspect that switching devices in the middle of a run is probably not a good idea
So to start I'd suggest creating a project folder for each device you are trying to test. Then run cucumber in one folder to test the first device and then a second folder to test the second.
Once you have that working then you can think about how to run both things at the same time, without having multiple project folders on your machine. There are lots of ways to do this
setup a dedicated CI machine
use a CI service like CircleCI
...
The key idea here is to parallize using multiple Cucumber instances rather than a single cucumber instance.
Related
We have a testing framework made in AutoIt for our Windows apps (older legacy apps that we will continue supporting). These have never been run on a schedule or part of CI (always been run manually). I tried to get some kind of auto run (or even just status reporting) out of the tests, with minimal luck.
I have a VM where the tests can run. I experimented with my own web app, which works okay locally for running and status reporting. But when set up on the server, AutoIt reports it cannot open the application. Same thing happens if I try to run the tests from a .bat file.
My current solution is to have AutoIt call my web app to report status (working okay locally, untested on the server), or to see if I can get AutoIt to report results back to TeamCity. I have the agent installed but when I run the build from TeamCity, AutoIt reports it can't launch the application. I tried this while logged into the VM, logged out, with RDS open; no luck.
Is it possible to run the tests manually from the VM and send results back to TeamCity? When I run them from TeamCity it reads the AutoIt output (which is in the expected format), but I need to let TeamCity know to update the results (so we can use TeamCity rather than my web app to show the results).
I may need to find a way to let TeamCity know a build has been started, which might then let it know to keep an eye on the process' output, but I'm not positive. Any ideas?
I solved this so it could be done more traditionally.
If anyone is confused by what "running the agent from the console" meant, it just means installing the agent without selecting the "as a service" checkbox, and then manually starting the agent by cd'ing to the BuildAgent/bin directory and running the command agent start. I also created a batch file that will do this automatically (but you must run it as admin).
Further, I found AutoIt couldn't do anything if the test doesn't run from the right directory, so I had to devise a solution to this.
The only issue now is that I have to have an old laptop always connected to the virtual machine the tests and app run on (since the AutoIt tests won't work without the VM desktop being interactive).
It seems really bizarre that Visual Studio for Mac (the recently-renamed Xamarin Studio) doesn't support automated unit testing for their mobile device (Android/iOS) applications. Actually, I guess it isn't that bizarre, they REALLY want you to pay for their cloud testing service.
How can I run my own automated unit tests, on my own machine? Here's what I mean by that - I want to create an application that:
Contains C# files containing unit tests that require NO user interface
Can be invoked from my Jenkins or Hudson automated build server
Can run on either a physical iDevice attached to the build server, or the iPad simulator
Runs all unit tests, reports their pass/fail status back to the build server, and then exits, all without any human intervention.
It seems like I could do this on the simulator using
xcrun simctl spawn
and then either
Have my test app writes its output to its storage and figure out where on my Mac's hard disk the simulator storage lives, or
Have my test app send its output to the simulator's pasteboard and grab it using
xcrun simctl pbpaste
But these both require that I find a way to write a C# app that runs on iOS, runs my tests, stores the output where the "real world" can find it, and then shuts down.
And I have to figure out how to copy all of the necessary EXEs and DLLs over to the simulated iPad? Or have Visual Studio package it all into an actual Mac app?
To run unit tests on an actual device you can use NUnit.Xamarin. This is a library that creates a Xamarin.Forms app that you can run on the real device, and this app will look for unit tests and run them:
https://github.com/nunit/nunit.xamarin
You have to run this manually as an app and look at the results. If you want to automate that part then you can create a Xamarin UITest automated test to launch your app, let the tests run then download the results.
https://developer.xamarin.com/guides/testcloud/uitest/
This is something we do using Jenkins as part of our standard mobile app pull requests. Jenkins runs a script that runs the UITest unit tests to launch the unit test app, wait for a result then grab the output and either pass or fail the UI test depending on the result of the screen output.
We just look for 'Test passed' or 'Test Failed', and if the test fails we manually run them to look for what went wrong, but you could expand on the UI test to download the results.
I've developed an application using Polymer 1.0. My developer computer is a Mac, and I've not had any problems during development process.
However, when I clone my application on a Windows machine (Windows 10), the tests don't work at all.
Whenever I execute polymer test or wct the command blocks the terminal and never ends.
On MACOS or Linux it works perfectly.
The following environment variable values have saved me in Win10 environment:
LAUNCHPAD_BROWSERS=chrome
LAUNCHPAD_CHROME=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
It is not obvious from Polymer and launchpad documentation the need to set only single browser with known location to minimize the test run time during ongoing development. Of course for multiple browsers autodetection it will take more time and traverse over all PATH with guess on all possible browsers takes forever. It would be reasonable not to rely on auto-detection and list in LAUNCHPAD_BROWSERS only browsers you have set in LAUNCHPAD_xxx location.
I finally found a workaround.
It seems that there is a bug in Web Component Tester. When it tries to find all the browsers installed on a windows machine it takes ages to locate some of them.
To solve this problem, just adds an environment variable that tells WCT which browsers are installed, so it can skip this step:
LAUNCHPAD_BROWSERS= _{coma delimited list of browsers}_
For instance:
LAUNCHPAD_BROWSERS=chrome,firefox,opera
Once this variable has been set, all the tests execute just like on any other OS.
More information about this feature here
I am creating Selenium test using Chrome Driver. To run test on my machine, I run Chrome Driver from the path in my computer like,
Instance = new ChromeDriver(#"C:\Users\..\);
But the point is, if somebody want to run my test using NUnit, it doesn't work because the path of the Driver is the one associated to my machine no to the machine that the other person is using.
So, is it possible somehow to attach the Driver to the project without writing path and be able to run in all machines without changing anything?
I have not used NUnit. But I understand your issue & This is how i do.
I use TestNG framework to run my selenium-webdriver regression scripts. I run the scripts periodically using jenkins in different slave machines (windows/mac). Chrome and IE driver servers are part of my project. (i just added to my project folder). I find the absolute path to these drivers # runtime and use it to start the service. So this way it does NOT depend on the machines or users who runs it. It works great. I would suggest you the same!
I'm building a simple client-server application in C, and using Xcode as an IDE to develop it. It's my first time using Xcode for anything, so i'm a little green with the options.
I've created two targets, one for the client and one for the server. I can build and run either one just fine. However when I want to build and run both (IE execute client while server is running) the client build immediately disappears.
If i try to run two instances of the same target, say server and server, I will get a prompt as to whether I want to stop the original process or add the new process. I don't get the same prompt trying to run client while server is running.
The odd thing is when I set a breakpoint somewhere in the client source, the whole thing runs as expected. How can I get this to be the default behavior?
Thanks
I think the accepted answer is outdated. In Xcode 9, as long as you have two targets, one per app, you can select the first target and press 'run' to start that debugging session, and while that's running, change to the second target and press 'run' again and the second app will start.
In the debugger pane, you'll see a dropdown that lets you select which target you want to see the output from.
What I haven't yet found is how to automatically start them both from the same scheme. It's still a manual process, but it doesn't require multiple instances of Xcode or using the command-line.
The Xcode debugger can only be hooked to one application at one time.
In my own Client / Server debugging, what I usually do is either have two machines running Xcode, where one is testing with the Server and other is testing with the Client.
If you have only one machine, what I usually do is run an instance of the server or client from the command line (you can launch any app by going to the "Products" folder where the built products are kept, and then typing in "ProductName.app/Contents/MacOS/ProductName"; the application binary is kept inside the application's package) and then I run the Xcode debugger on the actual thing I'm targeting for debugging.
Hopefully this makes sense!