SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Apr 2004
    Location
    California
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Execute batch file from selenium?

    Hi All,

    Just wondering if there is a way to execute batch file right from your selenium test? I'm using following:

    Windows XP
    Selenium RC2
    Java/TestNG

  2. #2
    Member
    Join Date
    Apr 2004
    Location
    California
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Execute batch file from selenium?

    The scenario I have to automate is as following:

    1. Create a appointment for client
    2. Step E 1 creates a record in some DB table to to send the appointment email.
    3. Run the batch file to process all the records in events table
    4. Verify email is received

  3. #3
    Junior Member
    Join Date
    Feb 2012
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Execute batch file from selenium?

    I think you can use the Java to trigger the Batch file in this case.

  4. #4
    SQA Knight
    Join Date
    May 2006
    Location
    Playa Del Rey, California, United States
    Posts
    2,594
    Post Thanks / Like
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Execute batch file from selenium?

    In your programming langauge, just fork a Process thread.

    In Java you might have something like..
    <font class="small">Code:</font><hr /><pre>
    final Runtime rt = Runtime.getRuntime();
    try {
    Process p = rt.exec("cmd /C C:\folder\project\mybat.bat");
    } catch (final IOException e) {
    throw new RuntimeException("Failed to run bat file.");
    }
    </pre><hr />
    David Lai
    SDET / Consultant
    LinkedIn profile

  5. #5
    Member
    Join Date
    Apr 2004
    Location
    California
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Execute batch file from selenium?

    Awesome... Thanks Dlai..

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 01:43 PM.

Copyright BetaSoft Inc.