I successfully integrated Ranorex with our Jenkins setup but I'm experiencing some difficulties with WaitForValidLicense method.
Currently, we have one floating Premium and one floating Runtime license. But because our Jenkins configuration uses two build&test slaves (oh man I feel like a slaveholder;)), we are sometimes short of available licenses. Before we buy some more licenses, I hoped to enhance my Ranorex tests with WaitForValidLicense check. Unfortuantely, it does not work for me. If both licenses are taken, the next Ranorex test started from Jenkins fails with "no suitable license was available" error (it does not wait for a free RX license and there is no output "No free RX license available." in console).
Here is my WaitForValidLicense implementation...
Program.cs
class Program : CodeModules.CommonFunctions { public static xSpector.Repository repo = xSpector.Repository.Instance; [STAThread] public static int Main(string[] args) { Keyboard.AbortKey = System.Windows.Forms.Keys.Pause; int error = 0; // check if Ranorex license is available (if not, wait for 15mins/check every 5secs) Wait_For_Available_License(900000,5000); return error; } }CommonFunction.cs
public static int Wait_For_Available_License(int WaitForLicenseTimeout, int WaitForLicenseInterval) { bool RXLicenseAvailable = Ranorex.Core.ElementEngine.WaitForValidLicense(new Ranorex.Duration( WaitForLicenseTimeout), new Ranorex.Duration(WaitForLicenseInterval)); if (RXLicenseAvailable) { System.Console.WriteLine("RX license avaliable!"); return 1; } else { System.Console.WriteLine("No free RX license available."); return 0; } }Does anyone see an error in this WaitForValidLicense implementation? Should I call it from somewhere else?