How can I get the current running recording GUID?

Class library usage, coding and language questions.
ewu
Posts: 5
Joined: Mon Dec 03, 2018 6:32 pm

How can I get the current running recording GUID?

Post by ewu » Fri Mar 08, 2019 8:06 pm

Hi,

How can I get the current running recording GUID?
I need to log the current running recording guid to database.

Thanks,
Emma

manish
Certified Professional
Certified Professional
Posts: 53
Joined: Fri Aug 10, 2018 12:46 pm

Re: How can I get the current running recording GUID?

Post by manish » Mon Mar 11, 2019 9:20 am

Hi,

You can find the GUID of the current running testcase in the *.rxtst file i.e. the test suite file.
Its an XML file where you can search the testcase name and find the corresponding GUID.

Hope it helps
Manish

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

Re: How can I get the current running recording GUID?

Post by odklizec » Mon Mar 11, 2019 9:45 am

Hi,

Another possibility is using this code, placed inside the module of your choice:

Code: Select all

	TestModuleLeaf curModule = (TestModuleLeaf)TestModuleLeaf.Current;
	string getName = curModule.DisplayName; // returns cur. module name
	var getGUID = curModule.Id; // returns cur. module GUID
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