0

I am using selenium webdriver maven setup.

So if I use driver.close() in code, I am getting error like below why it is can any one help on this.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project MavenSelenium: There are test failures.
[ERROR] 
[ERROR] Please refer to C:\Users\D23450277\workspace\MavenSelenium\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 

Thank you.

plsgogame
  • 1,334
  • 15
  • 28
Raju
  • 137
  • 2
  • 4
  • 15
  • And whats in the log? – Pavel Janicek Mar 21 '13 at 13:22
  • Hi thanks for your reply. ... Log is the same as mentioned above. Now it is working fine..Solution: From excel sheet I am getting null data thats why the error coming. I kept if condition if(Stackcode!=null) driverclose() then it is working fine.. – Raju Mar 21 '13 at 13:41
  • maybe later after the driver.close you expect driver to be up and running. But I am really guessing. I need to know what you tried, what happened, when does it fail and how the code looks like around the point when it fails... – Pavel Janicek Mar 21 '13 at 13:43
  • Hi Pavel, Thanks for your reply.. Can you send your skype id So that it would be helpful to share Selenium experience. – Raju Mar 21 '13 at 14:00

1 Answers1

0

Close will shut the current active window and if it is the last window will then perform a quit().

It does however need to have a valid active session to be able to do this. If your test has failed that session is probably dead, so when you call a close it doesn't know where to send the command and doesn't do anything.

Quit will shut down all clients if there are no active sessions so if you send a quit and have no active sessions it will just clean up, so in summary I would suggest changing all instances of driver.close() to driver.quit() unless you are closing down an additional window that has been opened up during your test.

Ardesco
  • 7,281
  • 26
  • 49