Skip to content

Commit d101726

Browse files
authored
Update README.md
1 parent a5ea664 commit d101726

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ Java library which allows to easily collect JavaScript errors received in Chrome
2424
site88Page.getTestButton().click();
2525
waitBeforeClosingBrowser();
2626
}
27+
28+
@AfterEach
29+
void closeDriver() {
30+
driver.quit();
31+
}
2732
```
2833

2934
### Example of TestNG usage:
@@ -57,8 +62,17 @@ public class JSCollectorTestNGTest {
5762
site88Page.getTestButton().click();
5863
waitBeforeClosingBrowser();
5964
}
65+
66+
@AfterMethod
67+
void closeDriver() {
68+
driver.quit();
69+
}
6070
```
6171

72+
### Closing your browser session
73+
74+
In order for the errors comparison to work properly, you should use 'AfterMethod' in TestNG and 'AfterEach' in JUnit in order to call driver.quit(). This would allow the listeners to interact with your WebDriver object after test execution.
75+
6276
### Annotation values
6377

6478
By default, using the annotation will cause your test to fail on JS errors received during Chromedriver session,

0 commit comments

Comments
 (0)