Forum Discussion

Sidharth24's avatar
Sidharth24
New Contributor
6 years ago

To write test Results into a column in excel

i have to print some content in notepad for each step, below is my code

 

//OutputPath = 'c:/work/test-results/abc.txt'
x = "4"
strOutputPath = context.testCase.testSuite.getPropertyValue("OutputPath")
// Creating output files.
objFOS = new FileOutputStream(strOutputPath, true)
// Filling output files.
objPW = new PrintWriter(objFOS)
x.print(objPW)// for printing in new line
// Closing the output.
objPW.close()
objFOS.close()

 

while i am adding above code in groovy step & rest API step - script assertion, i could able to see the output printed once in notepad as "4".

 

but when i used the same code in JDBC assertion script, my output is printed twice as "44".

 

i am using version 5.4.0

 

if any alternate way to print custom message to notepad, please suggest the same.

  • Sidharth24's avatar
    Sidharth24
    New Contributor

    i think, there could be some error with SOAPUI. Same code when i am executing at later part of day. i am not getting the error. It is printing only once.

     

    If someone faces smae kind of problem. Please post your solution here