Parameterisation on objects creation

Hi , Please help me on this
Can I create objects using csv file
Example : In any of the online shopping website we have filter criteria , so my filter criteria is like this
Gender : Female
Category : Tops
Color : Blue , Red
In this scenario color has 2 values,
so to automate this I have captured objects for blue and took copy of this object and update to Red color saved as another object and used
So My question is instead of doing this manually for all my elements in the application is there any other way like csv/excel uploads to create objects
Thanks in advance

1 Like

Possibly you do not have to (or rather you should not) make many many TestObjects. You can create a limited number of TestObjects which accept parameters runtime. See the followin document.

1 Like


As kazurayam said, you can create a test object in runtime, for example:

// Creates object in runtime
myNewObject = new TestObject('NewRuntimeTestObject')
// Adds properties to object:
//  property name (tag, id, text, ...),
//  condition type,
//  property value,
//  boolean for to use the property to find the object
myNewObject.addProperty('text', ConditionType.EQUALS, varwithtextvalue, true)

You can use ‘varwithtextvalue’ to store de colours, on CSV or Excel file. Remenber to use correct property, in the example, above, I use ‘text’, but you must replace it for the correct one on your test envrnment.

I hope this could help you to find a solution to your issue.