Page 1 of 1

How do I get Element from IElement?

Posted: Tue Nov 25, 2008 11:42 pm
by taralex
I learnd how to browse the tree of application elements (IElement.Children) and find the required element by its attribute name. However, now I need to click it, but Click method belongs to Ranorex.Element object. How do I get the Ranorex.Element object out of the corresponding Ranorex.Core.IElement object?

Posted: Wed Nov 26, 2008 9:54 am
by Support Team
Hey taralex,
you can use the Ranorex.Core.Mouse class for IElement/Element Objects.

Code: Select all

Element elem = CalculatorObjects.Button7.Element.As<Element>();
Mouse.Click(elem);

(maybe this conversion will not work with Preview Revision lower than Build 4593)

in Ranorex 2.0 Preview (Build 4395 - October 21, 2008) you can use the IElement Object instead.

Regards,
Chris
Ranorex Support Team