Create Ranorex Variables during runtime

Class library usage, coding and language questions.
Tobi_G
Posts: 1
Joined: Fri Oct 16, 2020 9:59 am

Create Ranorex Variables during runtime

Post by Tobi_G » Fri Oct 16, 2020 10:31 am

Hi,

I´m currently struggling with creating Ranorex Variables during runtime. My Idea is to create my Ranorex Global Variables within a Script Code from a typical "List of Names" and store them in the Clipboard. So i could Paste them into a Recording module if i wish to.

Here you can see my Dummy Code (it´s not working):
System.Collections.Generic.List<Ranorex.Core.Data.VariableStore.Entry> l = new List<Ranorex.Core.Data.VariableStore.Entry>();
        	Ranorex.Core.Data.VariableStore.Entry entry;
        	Ranorex.Core.Data.VariableStore.Entry.Create("test1",Guid.NewGuid(),"", out entry);
        	l.Add(entry);
        	
        	Clipboard.SetDataObject(l);


As result i should be able to paste the Variables like in the Screenshot shown.

Can you help me why it´s not working properly?
Attachments
afterpase.png
afterpase.png (5.1 KiB) Viewed 21 times

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

Re: Create Ranorex Variables during runtime

Post by odklizec » Mon Oct 19, 2020 6:57 am

Hi,

I seriously doubt that there is API for on-fly creation of Ranorex variables from code? I've never seen such API and if there is such a thing, its definitely not public ;) I'm sorry, but I somehow don't see the purpose of such thing?
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