How to send object to user code action

Class library usage, coding and language questions.
zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

How to send object to user code action

Post by zator » Tue Aug 14, 2012 2:14 pm

Hi again,

I have a simple question. I would like to send object\UI elements to user code action function?? Is is possible only by sending xPath as a string??

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to send object to user code action

Post by Support Team » Tue Aug 14, 2012 3:42 pm

Hi Pawel,

Do you mean as a parameter to the user code action in the recording view?

Regards,
Markus
Ranorex Support Team
.
Image

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: How to send object to user code action

Post by zator » Tue Aug 14, 2012 3:45 pm

Hi Markus,

Yes that is what i want to achieve. Additionally, this object can be in recording repository.

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to send object to user code action

Post by Support Team » Thu Aug 16, 2012 1:21 pm

Hi Pawel,

This is unfortunately in the recording not possible, you can just use strings as arguments.

Regards,
Markus
Ranorex Support Team
.
Image

orbistest
Posts: 23
Joined: Mon Oct 17, 2011 5:31 pm

Re: How to send object to user code action

Post by orbistest » Fri Sep 14, 2012 4:51 pm

Am I missing something here?
Could you not pass the object rxpath to the user code and use a FindSingle to see if it is present and get the object pointer?

I must be misunderstanding the requirement. If so, please let me know.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to send object to user code action

Post by Support Team » Mon Sep 17, 2012 9:51 am

Hi,

You currently just can pass strings to the UserCode actions of the action table, but in order to pass a RxPath you can convert the RxPath to a String with "toString" or with the "ToResolvedString" method of the RxPath object.

Regards,
Markus
Ranorex Support Team
.
Image

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: How to send object to user code action

Post by zator » Wed Sep 19, 2012 8:48 am

Hi orbistest,

It IS possible to send xPath as parameter of user-code-action and everything works fine!
My problem was that i had to explain it to people using recorder who did not know what xPath is and I was interested if its possible to send items from reposiroty directly to user-code-actions. :D

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to send object to user code action

Post by Support Team » Wed Sep 19, 2012 4:09 pm

Hi,

Could it be that you talk about a normal method in a UserCodeModule and not about a UserCode Action from a Recording?
UserCodeAction.png
UserCodeAction.png (36.75 KiB) Viewed 1565 times
Regards,
Markus
Ranorex Support Team
.
Image

nehas
Posts: 6
Joined: Tue Feb 14, 2012 1:55 pm

Re: How to send object to user code action

Post by nehas » Tue Nov 06, 2012 2:38 pm

Hi Markus,

Could you please help me. I also wanted to pass the repository item as the argument to my user code.But as the argument is of type string it throws exception. So please suggest how to proceed.


Thanks
Neha.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to send object to user code action

Post by Support Team » Wed Nov 07, 2012 4:27 pm

Hello,

Could you please describe exactly what you did?
Could you please provide us the exception that you get?

It would be helpful if you provide us the code snippet.

Regards,
Markus (T)
.
Image