Page 1 of 1

How to send object to user code action

Posted: Tue Aug 14, 2012 2:14 pm
by zator
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ł

Re: How to send object to user code action

Posted: Tue Aug 14, 2012 3:42 pm
by Support Team
Hi Pawel,

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

Regards,
Markus
Ranorex Support Team

Re: How to send object to user code action

Posted: Tue Aug 14, 2012 3:45 pm
by zator
Hi Markus,

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

Paweł

Re: How to send object to user code action

Posted: Thu Aug 16, 2012 1:21 pm
by Support Team
Hi Pawel,

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

Regards,
Markus
Ranorex Support Team

Re: How to send object to user code action

Posted: Fri Sep 14, 2012 4:51 pm
by orbistest
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.

Re: How to send object to user code action

Posted: Mon Sep 17, 2012 9:51 am
by Support Team
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

Re: How to send object to user code action

Posted: Wed Sep 19, 2012 8:48 am
by zator
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ł

Re: How to send object to user code action

Posted: Wed Sep 19, 2012 4:09 pm
by Support Team
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
Regards,
Markus
Ranorex Support Team

Re: How to send object to user code action

Posted: Tue Nov 06, 2012 2:38 pm
by nehas
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.

Re: How to send object to user code action

Posted: Wed Nov 07, 2012 4:27 pm
by Support Team
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)