Selenium WebDriver Test Data Driven Framework - Run Test From Batch(.bat) File

We have successfully generated XSLT reports for our selenium webdriver software test data driven framework In STEP 20. If you see In STEP 20, We need to open command prompt, Then need to type many different commands to clean, compile, run and generate XSLT reports. So now let us Implement all these things In batch file to perform all actions by double clicking on batch file.

STEP 21
Prerequisite : Selenium webdriver software testing data driven framework creation steps from STEP 1 to STEP 20 should be Implemented. You will find the links for all the previous steps on THIS PAGE.

Batch File To Run WebDriver Test
Instead Of executing all commands one by one, We can create batch file to execute all commands when we run batch file. And then we needs to put that batch file under "WDDF" project where build.xml file Is stored to run selenium webdriver software test and generate XSLT reports. 

Download Batch File
It Is simple batch (.bat) file. I have created It to run whole selenium webdriver software test data driven framework and generate XSLT reports. You can download It from bellow given page.
Extract Batch.zip Folder. You will get "Run Test.bat" file Inside It.

Copy-Paste "Run Test.bat" file on "WDDF" project In eclipse. Now your project directory structure should display as bellow.



Running Selenium WebDriver Test From Batch File
For running selenium webdriver data driven framework software test, 
  • Go to your project's root folder -> E:\backup\Training\WDDF. File "Run Test.bat" will be available there.
  • Double click on "Run Test.bat" file to execute It.
It will execute your "WDDF" project's test and generate XSLT report.

Note : Create the shortcut of "Run Test.bat" file on desktop to access It easily. From now onward, We will execute our data driven framework software test from desktop shortcut of "Run Test.bat" file.

9 comments:

  1. As of now no issues for me, executed all as per your instruction and able to report XSLT reports.
    Regarding batch file, how to prepare the same? If I want to prepare the same for my project, how do I do this?

    ReplyDelete
  2. As of now no issues for me, executed all as per your instruction and able to report XSLT reports.
    Regarding batch file, how to prepare the same? If I want to prepare the same for my project, how do I do this?

    ReplyDelete
  3. Why Skipped Test Suite is shown as Failed with Null Pointer exception ?
    Can someone please help me out on this ? I want to get status as Skipped instead of failed for the Skipped Test Suite if skip status is set as Y

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. To create batch file for your own project follow these steps:

    1.Open notepad
    2. Enter below commads:

    call ant clear
    call ant compile
    call ant run
    call ant reports

    3. Save your file under the name u want and place under the same folder where your build.xml file resides.

    Run the file :-)

    ReplyDelete
  6. I get build failed, build.xml does not exist. it is in the same project directory right next to my batch file so it is there.

    ReplyDelete
    Replies
    1. Check! it may be in Window Explore! just not showed in eclipse, check!

      Mak

      Delete
    2. Check Windows Explore it may be there, just not showed in eclipse by now.

      Mak

      Delete
  7. please add also how to mail xslt report zip file in build.xml

    ReplyDelete