Professional Documents
Culture Documents
Code Snippets-20 10
Code Snippets-20 10
làng |
fb/giao.lang.bis
II. DEPENDENCIES
***********************
> https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java/4.0.0-
alpha-6
> Tự động hóa việc kiểm tra và download ChromeDriver thay vì download ChromeDriver
bằng tay và cấu hình trong code
https://github.com/bonigarcia/webdrivermanager
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.2.2</version>
<scope>test</scope>
</dependency>
@BeforeClass
public static void setupClass() {
WebDriverManager.chromedriver().setup();
}
@Before
public void setupTest() {
driver = new ChromeDriver();
}
@After
public void teardown() {
if (driver != null) {
driver.quit();
}
}
@Test
public void test() {
// Your test code here
}