mercredi 30 décembre 2015

TestComplete - How can I get the array elements that are stored in their 'var' object when using C#?

I'm trying to write simple automation test using TestComplete in C#. (Not JScript/C# Script, just C#)

I'm using their libraries as you can see here: http://ift.tt/1TpWbOG

and specifically their 'var' type: http://ift.tt/1SmNiaq

I'm trying to identify all the elements on the screen according to specific key and value, using the method "FindAll" (http://ift.tt/1TpWaKL)

var a = someProcess["FindAll"]("text", "Simulate", 200, false);

In debug mode I can see that "a" has two encapsulated elements that he found and this line passes successfully.

The problem: I'm trying to get the first element, using the line

var b = a["0"];

and get a 'MissingMethodException'.

If I try to use

var b = a(0);

it says I'm trying to use variable as a function.

I couldn't find any method that can help me to get the elements.

Please help

Thanks a lot!

Aucun commentaire:

Enregistrer un commentaire