Output a text file from Ranorex to include just a pass/fail result and a number -


i trying ranorex output text file following:

pass
74

the pass/fail result obtained based on whether test running has passed or failed. number hardcoded need store in variable , include in output.

i have thought have been simple i'm struggling ranorex. though might able use reporting function, change output file type , alter report structure didn't work either.

although used ranorex , writing own user code, new adapting in way.

all user code written in c#

can offer assistance?

thanks!


edit: i've managed ranorex output text file , can put text it, including string stored in variable.

however i'm struggling store pass/fail result of test in string can output.

i've discovered way relies on following:-

  • the user code must in separate test
  • this separate test must exist in sibling test case 1 main test in
  • both test case , case containing main test must both part of parent test case

for example:

parent tc
.....-adduser tc
.........-main test
.....-adduser failcheck
.........-user code

you can set adduser tc 'continue sibling on fail'

the user code follows:

    public static void output()     {             string result = "";         itestcase icase = testsuite.current.gettestcase("add_user_test"); // name of test case           if(icase.status == ranorex.core.reporting.activitystatus.failed){              result = "failed"; }         if(icase.status == ranorex.core.reporting.activitystatus.success){              result = "passed"; }          int testrunid = 79;          using (streamwriter writer =                new streamwriter("testresult.txt"))         {             writer.writeline(testrunid);             writer.writeline(result);                        }     } 

this take testrunid (specific each test case) , result of test , output text file.

the idea read in file custom java application i've developed , push data test case management program such qa complete can mark tests passed/failed automatically


Comments