Automation by xpath, object names and values through excel sheet

I tried to create such a parser for your file. It is possible, BUT:

1/ It is not possible to create objects dynamically, you have to define them in the test explicitly - when your data file contains 3 object, you have to do following:
TestObject to1 = new TestObject()
TestObject to2 = new TestObject()
TestObject to3 = new TestObject()
… and then it is possible to assign properties using parser script using to1.addProperty() method.

I’d recommend you to rewrite your Excel file into a single custom keyword, where you create all your TestObjects and then initialize it in a test. It may look like this:

And then it is very simple to use them wherever you want:

(you don’t have to create an instance of MyTestObjects as all objects are static).

Please visit this page to get more info about creating TestObjects and manipulating with its properties.

myobj1.png

myobj2.png

1 Like