Javi
Javi

Reputation: 81

automationelement write

Im working on a test to test a desktop application. Im using automation elements, from the API of microsoft. I want to write on textboxs. How can I write in a textbox that i get with an automationelement?

Im trying to make a test that navegate through an application, but i want to write in the textboxs that there are.

I already have the automation element of the textbox, but i dont know how to write.

What i can do it? And how it will be for clicking on buttons?

Thanks

Upvotes: 0

Views: 1084

Answers (1)

Kooki
Kooki

Reputation: 1157

Late, but maybe anyone need it in future:

To edit a value of an AutomationElement u have to call:

ValuePattern editValue = (ValuePattern)myAutomationElement.GetCurrentPattern(ValuePattern.Pattern);

after that, u can edit with:

editValue.SetValue("Add ur value HERE");

Greetz Kooki

Upvotes: 3

Related Questions