Web License Manager

Ask general questions here.
radoslav.rakar
Posts: 1
Joined: Tue Nov 29, 2016 12:49 pm

Web License Manager

Post by radoslav.rakar » Tue Nov 29, 2016 12:56 pm

Hello,

I have a simple question. Is it possible to get number of used licenses from web?
We are using 30 licenses for our testing. But its difficult always go to look on our license server on virtual machine.
Simple for us will be to look on web if is it free licenses to start testing.

Thanks

Rado Rakar

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Web License Manager

Post by odklizec » Tue Nov 29, 2016 2:28 pm

Hi,

As far as I know, there is no web-based license manager available. The only way is to view the available licenses directly via License Manager (started on license server).

Anyway, if you just want to start your tests on VM (e.g. from command line), you can add a simple code to your test that will make sure the test waits for next available license. So the test will not immediately fail if there is no license available at the moment of test start. I'm using code like this:

Code: Select all

		/// <summary>
		/// This method checks and waits for available Rx license
		/// </summary>
		/// <param name="WaitForLicenseTimeout">wait time for available license (before giving up)</param>
		/// <param name="WaitForLicenseInterval">license check interval</param>
		/// <returns></returns>
		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;
			}
		}
And this line of code must be placed as a very first action in Main method in Program.cs...

Code: Select all

            // check if Ranorex license is available (if not available, wait for 15mins/check every 5secs)
            WaitForAvailableLicense(900000,5000); 
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration