SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ResExportOnClose logerror problem

    Hi gurus,
    I am facing a problem with ResExportOnClose function, in a way that ResExport doesn't output all the messages that are logged through logerror function.
    For Example if you have a testcase


    [+] testcase print_error() appstate none
    [ ] logerror("1234")
    [ ] logerror("abcd")
    [ ]
    [ ] ResExportOnClose("C:\temp\abc.txt")
    [ ]

    The file C:\temp\abc.txt contains only the "1234" error.
    What I want is the file should contain both the errors.

    did any one know the solution.

    I'm using silktest 5.5

    Thanks in Advance
    -srikanth

    ------------------

  2. #2
    Junior Member
    Join Date
    Jan 2002
    Location
    Santa Clara, Ca. USA
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    I think you are running into a control issue where the logerror () routine is transferring control out before your second message can be output to results. Look at RaiseError, from the help system:
    Action

    Raises an error with the specified exception number and places the specified error message, preceded by *** Error:, into the results file.

    Syntax

    RaiseError (iExcept, sMessage)

    Call this twice instead of LogError.

    ------------------

  3. #3
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    RaiseError halts a testcase. So it will never execute the second RaiseError. I ran into the same problem and Tech Support said there was nothing that can be done. An enhancement request has been raised.

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  4. #4
    Junior Member
    Join Date
    Jan 2002
    Location
    Santa Clara, Ca. USA
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    Tony is right as I just tried it, something reminds me of look before you leap? I found another call that should work, ExceptData (). Correct me if I did not understand, but your intent is to write to the results file these 2 errors. Using Do/Except and print() you can raise the error in do, then print in except, again see their example. If you want to count 2 errors this may not work but you'll capture the info in the .res file.

    ------------------

  5. #5
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    I believe the issue is writing out the results to a file using ResExportOnClose() which is where the problem exists in that it only will write out the first error. The .res file shows both errors.

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  6. #6
    Senior Member
    Join Date
    Apr 2001
    Location
    San Diego,CA,USA
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    I don't think you can use the ResExportonclose function to get the text for all the errors. but if you manually do extract result for the results menu you will see that the text file will contain all the error text.

    but to it programetically you will have to write something up

    ------------------

  7. #7
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    If you use ExceptData() and ExceptCall within a function you should get all the error logs you need for that function(the exception info get reset when you leave the function). Every test script has a .res file associated to it when you run it.\

    If you do print(ExceptCall(),ExceptData())
    it will write to that .res file for any # of calls. I don't know if the info for debugging purpose or reporting purpose. I use it to debug, and something else to report.

    ------------------

  8. #8
    Junior Member
    Join Date
    Oct 2001
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    Hi ljagelsk,
    I guess there is no problem with the control issue. If you see the result file (I mean the .res binary file) contains the two errors. The problem is when you try to export this .res file to .rex file(which is the human readable txt file) only one error is seen in the .rex file

    automation_guru, I tried to extract the result file manually It doesn't show up all the errors. I guess this manual export will inturn call the ResExport() function.

    -srikanth

    ------------------

  9. #9
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    I override the output functions of Silk to deal with issues like this. I have
    _Print()
    _Print2()
    _Print3()
    _LogError()
    _LogWarning()
    _ListPrint()
    etc.

    Inside these methods, they check for two booleans, WriteToHtml and WriteToText. If these are true, then any output I have will automatically write to my designated text output or Html output. I frequently call multiple _LogError statments in a row with no problem.

    ------------------

  10. #10
    Senior Member
    Join Date
    Apr 2001
    Location
    San Diego,CA,USA
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ResExportOnClose logerror problem

    I do get all the error text when I EXTRACT(Results>Extract) the results manually and not EXPORT.


    //*************TESTCASE
    [-] testcase testattherate() appstate none
    [ ] logError("Error 1")
    [ ] logerror("Error 2")


    //*******here is the extracted result file testScript.txt
    Script testScript.t - 2 errors

    Testcase testattherate - 2 errors
    Error 1
    Error 2

    //**********Result File
    [ ] Script testScript.t - 2 errors
    [ ] Machine: (local)
    [ ] Started: 12:34:06PM on 29-May-2002
    [ ] Elapsed: 0:00:00
    [ ] Passed: 0 tests (0%)
    [ ] Failed: 1 test (100%)
    [ ] Totals: 1 test, 2 errors, 0 warnings
    [ ]
    [-] Testcase testattherate - 2 errors
    [ ] Error 1
    [ ] Error 2


    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:14 PM.

Copyright BetaSoft Inc.