Forum Discussion

sdaubney's avatar
13 years ago

Parameterise Tested app

I was wondering if anyone could help, I need to set a parameter on my tested apps (firefox,iexplore,chrome) as well as on my long list of tests so that developers can select a browser and then a test from the parameters in the items menu.  Does anyone know how to do this?

Thanks
  • Hi,



    You can create UI for your test with user forms. When your test starts, display a form which will allow selecting the needed browser. You can get the list of available applications (added to TestedApps) using the TestedApps Object - iterate through the list of tested application using its Count and Item properties and get their names using ItemName.



    As for the list of tests, you can get it in a similar way. If by tests you mean KDT items, you can get them via the KeywordTests object. For example:



    var testList = new Array();

    var kdtProps = aqObject.GetProperties(KeywordTests);

    while(kdtProps.HasNext())

    testList.push(kdtProps.Next().Name);



    testList = testList.join("\r\n");

    Log.Message("Available KD tests", testList);





    If you mean functions in a unit, see this thread. Replace 'BuiltIn.EnumMethods' with 'aqObject.GetMethods' in the getMethodList function posted there.