Page 1 of 1

Unable to click on Button

Posted: Tue Nov 21, 2017 3:29 pm
by faheem412
Hi Team,

I need help, I am getting error 'cannot implicitly convert type 'ranorex.core.rxpath' to 'ranorex.unknown' when tried to execute below code

public void Click_Button(Ranorex.Core.Repository.RepoItemInfo item,string message)
{
if(item.Exists(5000))
{
Ranorex.Unknown ele= item.AbsolutePath;
ele.Click();
}
}

Re: Unable to click on Button

Posted: Tue Nov 21, 2017 3:35 pm
by odklizec
Hi,

You need to create an adapter from iteminfo element.
Just replace this line:

Code: Select all

Ranorex.Unknown ele= item.AbsolutePath;
with this line:

Code: Select all

Ranorex.Unknown ele= item.CreateAdapter<Ranorex.Unknown>(true);

Re: Unable to click on Button

Posted: Wed Nov 22, 2017 4:21 pm
by faheem412
Thank you so much. That worked :D