Unable to click on Button

Experiences, small talk, and other automation gossip.
faheem412
Posts: 13
Joined: Tue Oct 10, 2017 8:52 am

Unable to click on Button

Post by faheem412 » Tue Nov 21, 2017 3:29 pm

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();
}
}

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to click on Button

Post by odklizec » Tue Nov 21, 2017 3:35 pm

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);
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

faheem412
Posts: 13
Joined: Tue Oct 10, 2017 8:52 am

Re: Unable to click on Button

Post by faheem412 » Wed Nov 22, 2017 4:21 pm

Thank you so much. That worked :D