Page 1 of 1

Build error CS1501

Posted: Mon Mar 17, 2014 11:08 am
by rholdberh
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?

Re: Build error CS1501

Posted: Mon Mar 17, 2014 1:05 pm
by rholdberh
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

Re: Build error CS1501

Posted: Mon Mar 17, 2014 2:18 pm
by krstcs
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.

Re: Build error CS1501

Posted: Mon Mar 17, 2014 2:24 pm
by rholdberh
Aha..do you know antoher way to click on the button without mouse moves?

Re: Build error CS1501

Posted: Mon Mar 17, 2014 2:31 pm
by krstcs
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