Hi
I have created a function to perform click operation on buttons.I am trying to call that fuction by passing object from reporsitoy .But it is giving me error as cannot convert from 'Ranorex.Unknown' to 'Ranorex.Button'
Can you please help me to resolve the issue :
Funcation :
public bool fn_IsButtonVisibleEnabled(Button Objfusion)
// {
// Boolean visible = Objfusion.Element.Visible;
// Boolean enabled = Objfusion.Element.Enabled;
// if(visible == true && enabled == true)
// return true;
// else
// return false;
// }
#endregion
Locator from Repository :
/form[@title='Fusion']//element[@windowtext='Save']
Code module :
loc.fn_ClickButton(repo.Fusion.btnSave);
Cannot convert from 'Ranorex.Unknown' to 'Ranorex.Button'
-
- Posts: 32
- Joined: Thu Sep 20, 2018 7:43 am
Re: Cannot convert from 'Ranorex.Unknown' to 'Ranorex.Button'
Hi,
The element in question is apparently not a button, so why do you need to convert it to button? BTW, the click operation should be possible even on unknown element. So why do you need to convert it to button anyway?
The element in question is apparently not a button, so why do you need to convert it to button? BTW, the click operation should be possible even on unknown element. So why do you need to convert it to button anyway?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
-
- Posts: 32
- Joined: Thu Sep 20, 2018 7:43 am
Re: Cannot convert from 'Ranorex.Unknown' to 'Ranorex.Button'
I want to use the function as common function across my framework and pass the locator object at run time . So What can i define in the function ?
Re: Cannot convert from 'Ranorex.Unknown' to 'Ranorex.Button'
So keep it unknown? If I'm not mistaken, attributes like 'visible' and 'click' method should be available even for unknown elements?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
-
- Posts: 32
- Joined: Thu Sep 20, 2018 7:43 am
Re: Cannot convert from 'Ranorex.Unknown' to 'Ranorex.Button'
Yes ,It is working
Thanks for the help
Thanks for the help