Read parameters into array

Class library usage, coding and language questions.
karltinsly
Posts: 19
Joined: Tue Jun 07, 2016 9:59 pm

Read parameters into array

Post by karltinsly » Tue Sep 03, 2019 5:25 pm

I am building a large solution, and in the teardown would like to read all the parameter values and store them in a text file. I can do this easily enough if I create a usercode module that queries each parameter explicitly. However, I will be adding parameters as I continue to develop the solution and I would rather not have to modify the usercode each time.

Is there a way to read all the parameters into an array so I can use a For Each loop to write out the names and values?

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

Re: Read parameters into array

Post by odklizec » Wed Sep 04, 2019 2:06 pm

Hi,

TestSuite parameters are stored in idictionary. So you can access them like this:

Code: Select all

IDictionary<string, string> listOfParams = TestSuite.Current.Parameters;
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

karltinsly
Posts: 19
Joined: Tue Jun 07, 2016 9:59 pm

Re: Read parameters into array

Post by karltinsly » Wed Sep 04, 2019 2:57 pm

Yes, thank you!