Page 1 of 1

Test project build number

Posted: Mon May 06, 2019 7:19 am
by nirs
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

Re: Test project build number

Posted: Mon May 06, 2019 9:39 am
by odklizec
Hi,

You can change the test app version number in AssemblyInfo.cs file, which is a part of every project.
Versioning.png
Hope this helps? ;)

Re: Test project build number

Posted: Tue May 07, 2019 7:28 am
by nirs
Yes it's very helpful!
Thanks.
How can I add this information to my report?

Re: Test project build number

Posted: Tue May 07, 2019 7:43 am
by odklizec
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);