Axe Test Automation PlatformGeneral discussion relating to the Axe Test Automation Platform from Odin Technology |
||
Posts by Odin employees marked:
|
Hi, I am trying to write unit test for my custom action and I am struggling to create valid/mocked ITest(Test) instance. What properties need to be set ?
[TestMethod] public void TestCustomAction() { var axeTest = new Test(); MyCustomActions.TestIt(axeTest, "file.xls"); } public static int TestIt(ITest axe, string downloadAsFileName) { axe.StepInfo("Log stuff"); axe.TestAbort(); // here it fails with following exception : Value cannot be null. Parameter name: fileName }
Hi Vojtech,
Calls to StepInfo and TestAbort both need to be made in the context of an initialised running test since they write to the test results files. So adding a call to TestBegin should solve the problem. This will need to reference a valid results.xml in the correct Axe project structure. Sam |