Build error CS1501

Ranorex Spy, Recorder, and Studio.
rholdberh
Posts: 27
Joined: Mon Jan 13, 2014 3:45 pm

Build error CS1501

Post by rholdberh » Mon Mar 17, 2014 11:08 am

Hi,
i have change all my mouse clicks to user code and change them to PerformClick. Now when i am trying to build my project i am getting :

No overload for method 'PerformClick' takes 1 arguments (CS1501) - C:\..\RanorexStudio Projects\IDMExportTool\IDMExportTool\ExportTool_SearchExportFinishDownloadDelete.UserCode.cs:54,13

public void Mouse_Click_BtnSearch()
{
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IDMTool.SearchPanelPlusMainPage.BtnSearch' at Center.", repo.IDMTool.SearchPanelPlusMainPage.BtnSearchInfo);
repo.IDMTool.SearchPanelPlusMainPage.BtnSearch.PerformClick(300);
}
repo. is outlined with red.

Any ideas?

rholdberh
Posts: 27
Joined: Mon Jan 13, 2014 3:45 pm

Re: Build error CS1501

Post by rholdberh » Mon Mar 17, 2014 1:05 pm

I found where was the problem.
When you converting click to the user code, its taking duration time "300" and put it in .click(300).
But performClick doesnt support 300 as a value

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Build error CS1501

Post by krstcs » Mon Mar 17, 2014 2:18 pm

Be careful with PerformClick. It does not actually click with the mouse over the object, and instead just invokes the onClick() event on the element. If the events are not setup correctly in your SUT then some of the events may not fire with the PerformClick action.

I would use it sparingly unless you know for sure it will work for what you need.
Shortcuts usually aren't...

rholdberh
Posts: 27
Joined: Mon Jan 13, 2014 3:45 pm

Re: Build error CS1501

Post by rholdberh » Mon Mar 17, 2014 2:24 pm

Aha..do you know antoher way to click on the button without mouse moves?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Build error CS1501

Post by krstcs » Mon Mar 17, 2014 2:31 pm

There are only 2 ways to "click" an object.

Click() - moves the mouse to the object and then clicks at the location specified.
PerformClick() - invokes the onClick() event of the object (does not move the mouse and only fires the event).

I was just wanting to let you know the side-effects of the PerformClick action in case you run into trouble.

:D
Shortcuts usually aren't...