Page 1 of 1
How to execute test cases in multiple devices?
Posted: Fri Jul 10, 2015 7:09 am
by sunil.pandey
Hi,
can anybody please let me know
"How to execute test cases in multiple devices if I've only one Ranorex licence (Using Jenkins)"
Thanks & Regards,
Sunil
Re: How to execute test cases in multiple devices?
Posted: Fri Jul 10, 2015 7:20 am
by odklizec
Hi,
If you have just one license, you will have to run your tests sequentially. Once a test is finished on one device, you can start it on another. Eventually, you can add a "wait for available license" method to your solution, so the tests will not fail due to unavailable license
I'm using something like this:
public static int WaitForAvailableLicense(int WaitForLicenseTimeout, int WaitForLicenseInterval)
{
System.Console.WriteLine("Waiting for RX license...");
bool RXLicenseAvailable = Ranorex.Core.ElementEngine.WaitForValidLicense(new Ranorex.Duration(WaitForLicenseTimeout), new Ranorex.Duration(WaitForLicenseInterval));
if (RXLicenseAvailable)
{
System.Console.WriteLine("Rx license available.");
return 1;
}
else
{
System.Console.WriteLine("No Rx license available! (waited " + TimeSpan.FromMilliseconds(WaitForLicenseTimeout).TotalMinutes.ToString() + " mins)");
return 0;
}
}
The above method must be called as the very first thing in Program cs, e.g. like this:
// wait for license 15mins/check every 5secs
WaitForAvailableLicense(900000,5000);