Selenium Testing Framework : Implement Test Case Skip Function

STEP 13
PrerequisiteSTEP 1 to STEP 12 should hold upwardly Implemented equally described.

In previous ii steps, We accept learnt how to skip specific software automation examination suite's execution from your examination together with thence reported software examination suite execution condition In excel file. So this was our basic requirement of our selenium software automation framework which Is driven past times information of external excel sheet.



Why Need Test Case Skip Function?
Now other requirement of this webdriver automation framework Is It should hold upwardly able to skip specific examination illustration from the execution If "CaseToRun" = "N" against examination illustration In excel sheet. Example : You accept a software examination suite amongst five dissimilar examination cases. From these five examination cases yous wants to run alone iii examination cases together with wants to skip remaining 2 examination cases.

How To Skip Specific Test Case From Execution
We accept ready made "checkToRunUtility" purpose In "SuiteUtility" shape which Is using "retrieveToRunFlag" purpose of "Read_XLS" shape to remember "CaseToRun" flag from "TestCasesList"  sheet of examination case's excel files. So nosotros volition utilization this purpose In our all 4 software examination cases of both examination suites. We volition depository fiscal establishment gibe "CaseToRun" flag In @BeforeTest method of every examination illustration class.

Skip Test Case From Execution
Step 1 : 
Now permit us endeavour to skip execution of "SuiteOneCaseOne" examination illustration from "SuiteOne" together with "SuiteTwoCaseTwo" examination illustration from "SuiteTwo". For that yous accept to laid "SuiteToRun" together with "CaseToRun" flags of all the examination suites together with examination cases In dissimilar excel sheets equally shown In bellow given Image.

Step 2 : 
2d pace Is yous accept to alter existing examination case's coffee files of our information driven selenium software testing framework projection "WDDF". I accept already modified those files together with yous tin acquire those files past times downloading bellow given cypher folder.
Extract the downloaded folder together with copy-paste all 4 software automation examination cases files on existing files of "WDDF" projection In Eclipse equally described bellow to supercede existing files.
(Note : It should supercede existing file when glue It on package. It should non Insert novel file.)
  • Paste SuiteOneCaseOne.java File on com.stta.SuiteOne Package.
  • Paste SuiteOneCaseTwo.java File on com.stta.SuiteOne Package.
  • Paste SuiteTwoCaseOne.java File on com.stta.SuiteTwo Package.
  • Paste SuiteTwoCaseTwo.java File on com.stta.SuiteTwo Package.
Running Test
Note : Before running examination suite, Please brand certain that your all .xls files are closed. If whatsoever file Is opened upwardly thence yous volition acquire an mistake during examination suite execution.

Now nosotros are all laid run together with verify execution consequence of both examination suites. Run your examination suites using testng.xml file.

On completion of execution, Look at the console file. It volition impress information of alone "SuiteOneCaseTwo" together with "SuiteTwoCaseOne" examination cases In console. "SuiteOneCaseOne" together with "SuiteTwoCaseTwo" has been skipped from execution thence information volition hold upwardly non printed In console.

Testng execution consequence volition looks similar bellow.


So nosotros accept achieved our 2d finish of skipping specific examination cases from execution. Now You tin laid "CaseToRun" flag against examination illustration In excel files equally per your requirement to skip or execute that software automation examination case.

More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/

1 Comments

  1. What is SuiteUtility here and where do we find it?. I am confused. Do we have to add any jar file in our testNG to use it?

    ReplyDelete
Post a Comment
Previous Post Next Post