You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,11 @@ Java library which allows to easily collect JavaScript errors received in Chrome
24
24
site88Page.getTestButton().click();
25
25
waitBeforeClosingBrowser();
26
26
}
27
+
28
+
@AfterEach
29
+
void closeDriver() {
30
+
driver.quit();
31
+
}
27
32
```
28
33
29
34
### Example of TestNG usage:
@@ -57,8 +62,17 @@ public class JSCollectorTestNGTest {
57
62
site88Page.getTestButton().click();
58
63
waitBeforeClosingBrowser();
59
64
}
65
+
66
+
@AfterMethod
67
+
void closeDriver() {
68
+
driver.quit();
69
+
}
60
70
```
61
71
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
+
62
76
### Annotation values
63
77
64
78
By default, using the annotation will cause your test to fail on JS errors received during Chromedriver session,
0 commit comments