SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Aug 2002
    Location
    NY,NY,USA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to pass a message to another application

    How to pass a message to another application(say dos shell which is running the silktest) that the silk test has finished. running the tests and how to let the other application know that the testcase failed or passed. Also is there anyway to read a flat file in dos batch programming?

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

  2. #2
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to pass a message to another application

    It can be a little easier than that. There is a built-in commandline switch to handle this...

    Take a look in the SilkTest helpfile under commandline switches under -p

    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

  3. #3
    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: How to pass a message to another application

    I think the best way would be to write out the result of the testcase in a flat file and read that file from the dos. Or you can just check the existance of a file from dos If you don't want to read the file.

    in the test case do the following:

    do
    delete file xx.txt
    execute test
    if test passes
    write passed in file xx.txt
    else
    write failed in file xx.txt

    except
    write failed in file xx.txt

    in batch file do the following:

    set bPassed=FAILED


    start /wait partner -q -resexport -r yourscript.t

    for /f "tokens=*" %%i in (xx.txt) do echo %%i
    for /f "tokens=*" %%i in (xx.txt) do set bPassed= %%i

    if "%bPassed%"==" Passed" goto PROCCEED
    if "%bPassed%" NEQ " Passed" goto END

    :PROCEED
    rem start another test or something
    echo first test passed hence executing tests from another file
    start /wait partner -q -resexport -r yourscript2.t
    goto FINISH


    :END
    echo First silk test has failed so test for another file was not executed
    pause

    :FINISH

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

  4. #4
    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: How to pass a message to another application

    I am not sure if -p option can be used in a batch file because you will have to register a window message first and then silk will write to that message and then the batch file will have to read that message.

    First of all there is no command in dos to registerwindowmessage so you might have to write a little application to handle all that message business.
    I don't think it is trivial.

    correct me if I am wrong

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

  5. #5
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to pass a message to another application

    -p won't do much good from a batch file, but the original question was whether SilkTest could communicate back to another application that launches SilkTest. The batch file question was secondary.

    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

  6. #6
    Junior Member
    Join Date
    Aug 2002
    Location
    NY,NY,USA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to pass a message to another application

    I looked in the help and am not sure how to use the -p option has anybody used it or can any body help me on this

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

  7. #7
    Junior Member
    Join Date
    Aug 2002
    Location
    NY,NY,USA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to pass a message to another application

    I am using a batch file to launch tests is it possible to access the message from the batch file?

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

  8. #8
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to pass a message to another application

    Lets say you build an application that you want to launch SilkTest from. It can register a message with the OS called 'foo'.

    Then the application will call SilkTest using the -p option and passing in the name of the message SilkTest is supposed to respond to with the number of errors that the script found that was executed.

    Your application enters a loop after calling SilkTest to look for a message called 'foo' to be posted to the OS. When the message occurs, then the application can check the message for the number of errors that occurred and the respond occordingly

    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

 

 

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 10:57 AM.

Copyright BetaSoft Inc.