Without Recording , click on element

Best practices, code snippets for common functionality, examples, and guidelines.
sawaiabhishek
Posts: 2
Joined: Wed Dec 28, 2016 12:19 pm

Without Recording , click on element

Post by sawaiabhishek » Wed Dec 28, 2016 12:51 pm

Hi There,

I would like to click on element with its xpath , but without recording it.

Can someone please suggest the flow to achieve this ?

User avatar
N612
Posts: 64
Joined: Mon Jul 11, 2016 4:01 pm

Re: Without Recording , click on element

Post by N612 » Wed Dec 28, 2016 8:27 pm

Hello,

Do you mean RanorexPath (RxPath) or Xpath? They are very similar, but are different. You will need the RxPath in order to perform the below.

When recording, you are automatically adding each element you interact with to a repository, then performing an action on that repository element. If you wish to do this manually, you will need to do so in a code module.

See below for an example of clicking on the windows start button. First, create the element, then perform the action you wish on that element.

Code: Select all

Button myButton = Host.Local.FindSingle("//button[@accessiblename='Start']");
myButton.Click();
I hope this helps!