I am building a keyword "action" based framework that will allow testers to write tests in syntax of:
<action> <ranorex xpath> <additional data>
e.g. SET <xpath of a text box> HELLO
To implement this the code behind the action will use the xpath to find the control as a Ranorex.Element
It then needs to convert that in this case to a Ranorex.Text class
What is the best way to do this, is it doing ?
Code: Select all
public void set_method(string xpath, string data) {
var element = Ranorex.Host.Local.Find<Ranorex.Element>(xpath);
var text = new Ranorex.Text(element)
text.TextValue = data;
}
Cheers.