refering a global parameter withinn a class

Ask general questions here.
User avatar
sandamal
Posts: 28
Joined: Wed Jul 08, 2015 7:50 am

refering a global parameter withinn a class

Post by sandamal » Fri Jul 01, 2016 9:05 am

hi,

If I'm writing a c# class withing ranorex project (basically to open a connection with sqlserver DB) how can i refer the global parameters within it.

Not via data binding in UI.

> Connection string is in a global parameter.

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

Re: refering a global parameter withinn a class

Post by odklizec » Fri Jul 01, 2016 9:34 am

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

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: refering a global parameter withinn a class

Post by Martin » Fri Jul 01, 2016 10:27 am

Can't really figure out the "Object reference not set to an instance of an object" exception (NullReference).

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

Re: refering a global parameter withinn a class

Post by odklizec » Fri Jul 01, 2016 11:53 am

I guess you started an individual module instead of entire TestSuite? Global Parameters are a part of Test Suite! So you must start the whole TestSuite, not just individual module!
Last edited by odklizec on Fri Jul 01, 2016 11:55 am, edited 1 time in total.
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

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: refering a global parameter withinn a class

Post by Martin » Fri Jul 01, 2016 11:54 am

Ofcourse! Thanks for the hint. I actually knew that the context exists as such.