mardi 20 septembre 2016

Spock: How to clear cookies for every data set of where block

I have one test case where I am doing something like hotel search:

1.Open home page

2.Select some options from drop-down list and check some checkboxes

3.Select adult and child person count and blb bla bla

4.Fially click the search button to view the result

The problem I am facing here is that, when I perform the above test for one set of data coming from where block, than for the next iteration with next set of data, the check boxes and drop-downs are kept selected from the previous iteration.

I am trying:

browser.clearCookies() 
browser.clearCookiesQuietly()
driver.quit() --- which generates session related errors
driver.close() --- which generates session related errors

How can I reset the home page to clear the previously selected options?

Aucun commentaire:

Enregistrer un commentaire