Test project build number

Ranorex Spy, Recorder, and Studio.
nirs
Posts: 7
Joined: Mon Mar 12, 2018 10:35 am

Test project build number

Post by nirs » Mon May 06, 2019 7:19 am

I would like to create and maintain a build number to our test project, that will advanced every ranorex's test build (v1.0 , v1.1 , v1.2 etc. or maybe 1.0, 2.0, 3.0 etc.))
Any suggestions?

Thanks in advance,
Nir

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

Re: Test project build number

Post by odklizec » Mon May 06, 2019 9:39 am

Hi,

You can change the test app version number in AssemblyInfo.cs file, which is a part of every project.
Versioning.png
Versioning.png (73.98 KiB) Viewed 84 times
Hope this helps? ;)
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

nirs
Posts: 7
Joined: Mon Mar 12, 2018 10:35 am

Re: Test project build number

Post by nirs » Tue May 07, 2019 7:28 am

Yes it's very helpful!
Thanks.
How can I add this information to my report?

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

Re: Test project build number

Post by odklizec » Tue May 07, 2019 7:43 am

Hi,
You can do it by below code.

Add this namespace...

Code: Select all

using System.Diagnostics;
Then use this code in user code...

Code: Select all

System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;
Report.Info("Version", "Test version" + version);
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