RUN doesn't work with item in list?

Ok I have a list of lists, each sub list has a target sut, interface type, and software version. An example of one such object would be:
push (label:“TestBench01”,version:“SYS9.5.3”,interface:“Type_01” into TestBenchList
this is repeated for each test bench

From this TestBenchList I randomly select one object (defined above) called TestBench.

set testList to (“MapTest”,“ParametersTest”,“ButtonTest”)

I then have a loop:
repeat with each testScript of testList
RunWithNewResults testScript, TestBench
end repeat

Here is where my problem lies:

In the script MapTest
I start with:
params testBench

Run testBench.interface, testBench.label, “Validate”, testString

For some reason the above command generates an error 'No Such command ‘interface’.

However if I do this it works fine:
put testBench.interface into interface
Run interface, testBench.label, “Validate”, testString

As far as I can tell the string in ‘testBench.interface’ is the same as the string in the simple object ‘interface’. It’s rather clunky to have to re-declare an object every time I want to call the script. Am I doing something wrong or is this a Functional issue?

Note: ‘interface’ contains the string name of a script that is to be run. Anytime the test is called it may run a different for a different platform and/or software version as such the interface script knows where to find the GUI elements needed for the test - because of the variety of interfaces I can’t hard code the script name.


Hi Forest, you need to put brackets around the property list access for the script name:

Run (testBench.interface), testBench.label, "Validate", testString

You can also use “of”:

Run interface of testBench, testBench.label, "Validate", testString

Thanks Martin!