Setting a value of two combined variables

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
mariya.syera
Posts: 9
Joined: Wed Nov 08, 2017 10:59 pm

Setting a value of two combined variables

Post by mariya.syera » Thu Mar 01, 2018 9:35 pm

Using action Set Value, how do I set a value of two combined variables?

Something like this:
You do not have the required permissions to view the files attached to this post.
Mariya Syera
Office Ally, Inc

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

Re: Setting a value of two combined variables

Post by odklizec » Thu Mar 01, 2018 10:03 pm

Hi,

I’m afraid, that’s currently not possible with SetValue action. You will have to convert the SetValue action into user code and then merge both variables in code.
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

markos
Posts: 17
Joined: Tue Mar 28, 2023 12:20 am
Contact:

Re: Setting a value of two combined variables

Post by markos » Tue Dec 12, 2023 10:39 pm

Not having a built-in feature to concatenate variables is annoying.

On the other hand, creating a custom code is a "one-liner" like this:

Code: Select all

        [UserCodeMethod]
        public static string concat3strings(string s1, string s2, string s3)
        {
        	return s1 + s2 + s3;
        }