selenium
This commit is contained in:
24
test/searchTest.js
Normal file
24
test/searchTest.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const { Builder, By, Key } = require("selenium-webdriver");
|
||||
require('chromedriver');
|
||||
|
||||
async function searchTest() {
|
||||
|
||||
let driver = await new Builder().forBrowser('chrome').build();
|
||||
|
||||
//
|
||||
await driver.get("https://mialala.vn/")
|
||||
|
||||
|
||||
// nhap text tìm kiếm
|
||||
var text_search = 'Đồ ngủ';
|
||||
|
||||
await driver.findElement(By.id("js-global-seach")).sendKeys(text_search, Key.RETURN);
|
||||
|
||||
|
||||
|
||||
setInterval(() => {
|
||||
driver.close()
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
searchTest()
|
||||
Reference in New Issue
Block a user