Save path in variable and copy path

Ask general questions here.
Alleb14
Posts: 3
Joined: Wed Oct 23, 2019 1:58 pm

Save path in variable and copy path

Post by Alleb14 » Wed Oct 23, 2019 2:11 pm

Hi to all,

I'd like to save a file-path in a variable and then track the searchfield of another program and copy this path in this searchfield . Is it possible in any way?
I already saved the path in a variable.

Thanks! :D

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

Re: Save path in variable and copy path

Post by odklizec » Thu Oct 24, 2019 7:17 am

Hi,

To achieve what you want, you need to have a repo element of target element (searchfield) stored in repository. And the simply use [b]SetValue [/b]or Key Sequence action, to enter the content of variable to given input element. Both actions accept variables.
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

Alleb14
Posts: 3
Joined: Wed Oct 23, 2019 1:58 pm

Re: Save path in variable and copy path

Post by Alleb14 » Thu Oct 24, 2019 7:22 am

Hey,
thanks for your reply!
where do I find SetValue in a Repository? or do I have to put SetValue in my code module?

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

Re: Save path in variable and copy path

Post by odklizec » Thu Oct 24, 2019 7:57 am

Hi,

There is no such a thing like SetValue in repository. You just have to drag & drop an existing repository item to Recording table. Once you drop it, there should appear a menu, with available actions, for given repo element. Eventually, you can add new action to recording table with "Add new action" button and then you must assign added action with existing repository element.
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

Alleb14
Posts: 3
Joined: Wed Oct 23, 2019 1:58 pm

Re: Save path in variable and copy path

Post by Alleb14 » Thu Oct 24, 2019 8:54 am

Hi,

okay I think the problem I have is, that I didn't get how I may set a value in my KeySequence that is linked to the variable in my code module.
I read the User Guide about defining variables but it didn't help me.

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

Re: Save path in variable and copy path

Post by odklizec » Thu Oct 24, 2019 9:03 am

Hi,

To share data (variables) between modules, you need to use the method described here:
https://www.ranorex.com/blog/sharing-da ... o-another/
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