RE: How to handle expected error condition for invalid input fields from excel sheet with multiple data

Hi team, I have few questions and need your help on those,
> searched those in forums but no clues… Demo site : I have stared to
> created test script for RedBus
> site.http://www.redbus.in/?utm_expid=2728620-66.DWsJ0O30Rmu3dYV86uZD9A.0
> Data Input : Data need to be read from excel sheet(data driven), Values
> from sheet will have TestCases 1 to n , FROM, TO, DATE etc. Test Case1:
> Entering Positive values on screen, with From: To: Date:(Return) and
> click on submit should show the list of buses with the places chosen.
> Test Case2: Entering Negative value for field FROM:abc123 remaining other
> fields am entering positive value, now clicking on Submit will throw a
> message on same screen as \”OOPS No Buses for the mentioned search\”.
> TestCase3: Making From: blank and trying to submit. Problem is, values
> for three testcases should come from Excel sheet and need to handle both
> positive and negative cases. I know Assert can be used for checking
> condition, but not sure how to write code for this. Thing is First test
> cases should read value and click submit, then it should read next
> testcase2 value from excel and enter the values in the fields and should
> handle the \”Error message displayed\” and same for TestCase3.
>

dhana Default Asked on September 23, 2014 in Selenium WebDriver.
Add Comment
1 Answers

Hi Dhana

Not Sure That This is The Right Way But you Can Try This

> Hit Url Everytime for Each  Row
> Execute Test Case And Get That Error Message Every time and Store It in Some Arraylist

in This Way You Have The Messages For Every Test Case Whether They are Pass or Fail and your Test Case Continues to Run For all Rows

Regards
ankit

Vice Professor Answered on September 23, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.