SPONSORS:






User Tag List

Results 1 to 9 of 9
  1. #1
    Senior Member
    Join Date
    Nov 2001
    Posts
    375
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Automating a command line application

    Hi all,

    Can you automate a command line application with SilkTest?
    I tried Winrunner ( :/ ) and it hangs my machine! but is it possible thru Silktest?

    thanks,
    Aatish


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

  2. #2
    Member
    Join Date
    Aug 2001
    Location
    Ireland
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating a command line application

    Hi Aatish,

    I have worked in the past with AutoCAD which is a heavily command line driven application. I was able to do pretty much everything that I needed to do with SilkTest. But a word of warning - you are going to need patience (lots). Good Luck.

    Cheers,
    Conor


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

  3. #3
    Member
    Join Date
    Aug 2001
    Location
    Ireland
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating a command line application

    Try this line in your WinRunner script and see if it stops WinRunner from crashing.

    You need to set the following command in either your startup test or at the start of every script

    #necessary to recognise console window

    setvar("skip_nt_console",0);




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

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Posts
    375
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating a command line application

    Thanks Conor!

    (I know I am being a little stuborn here!)
    ...but is it possible to automate something on the command line with SilkTest?......are there any special steps?..etc?

    Thanks Again!
    Aatish


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

  5. #5
    Member
    Join Date
    Aug 2001
    Location
    Ireland
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating a command line application

    Yes, it is possible to automate from the command line. You could use (most likely anyway) SYS_Execute ().

    Simple example:

    SYS_Execute ("c:\temp\conor.bat")

    This would run the conor.bat from the c:\temp folder. I have done a bit of work on the command line and had no major problems. If you have SilkTest available try it for yourself.



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

  6. #6
    Senior Member
    Join Date
    Nov 2001
    Posts
    375
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating a command line application

    WOW!
    Thanks a tonne Conor!
    I guess it works better than Winrunner here!
    But now I have another problem
    This is what I want to do:
    1. Execute the command "xyz".
    2. Capture the output...say "Succesful!"

    Now the problem here is when I execute the command "xyz", the first output is a return key that takes me to the next line, then theres a wait of 10 seconds. After that "Succesful!" is displayed.

    When I do a SYS_Execute("xyz",lsOutput), the output captured in lsOutput is just a blank cause the lsOutput has been captured even before "Succesful!" has been displayed.

    So bottomline is can i delay the capture of the output by say "X" amount of seconds?

    thanks for all the help,
    Aatish


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

  7. #7
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating a command line application

    Batch operations are somewhat limited in their utility for acquiring responses. Even if you use a redirection ">", you still miss text that is written directly to stdout by the app'.

    For better interactive capabilities, you could just open a DOS window and use typekeys() to enter commands. Then use the window's own ability (right-click the title) to copy/paste through its Edit menu to the Clipboard . Use a typekeys("CLS<Enter>") to clear the screen between commands. All that remains then is a parsing issue.

    Rather than insert time delays just re-read the displayed text in a loop until the expected output appears.


    John


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

  8. #8
    Junior Member
    Join Date
    Jul 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating a command line application


    Hello Conor,

    I have another problem, If you/anybody has experienced. When SYS_Execute is called with the first parameter as the application executable name (along with full path),

    1. what is the successful value expected in iReturn? (I mean zero, non zero, negative, positive integer?)

    INTEGER iReturn = SYS_Execute( "start c:\winnt\notepad.exe", lsOutput)

    I am experiencing a strange behavior here. When executed on winnt STi and win2k STi sp3 the successful return values are not same.


    2. Also on WinNT, when forced to fail (by giving a non-existent executable name, return code is same as that for when it is successful !

    3. I am also wondering if it could be due to code in SP3 which would give a different return values for win2k and winnt ?
    Is there a known problem about this that you/anybody is aware of or am i missing anything here.

    Thanks,
    star

    >Yes, it is possible to automate from the >command line. You could use (most likely >anyway) SYS_Execute ().
    >Simple example:

    >SYS_Execute ("c:\temp\conor.bat")

    This would run the conor.bat from the c:\temp folder. I have done a bit of work on the command line and had no major problems. If you have SilkTest available try it for yourself.



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

  9. #9
    Senior Member
    Join Date
    Nov 2001
    Posts
    375
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating a command line application

    Well thanks to all of u...wrks like a charm...

    thanks again!
    Aatish

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

 

 

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 07:19 AM.

Copyright BetaSoft Inc.