A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Category_model_SelectMainMenu.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Category_model.php
Line: 53
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 106
Function: SelectMainMenu
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Category_model_SelectByParentArrayId_Blog.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Category_model.php
Line: 67
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 113
Function: SelectByParentArrayId_Blog
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Config_model_SelectByKeyaddress.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Config_model.php
Line: 42
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 122
Function: SelectByKey
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Config_model_SelectByKeyzalo.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Config_model.php
Line: 42
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 128
Function: SelectByKey
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Config_model_SelectByKeyfanpage_facebook.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Config_model.php
Line: 42
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 131
Function: SelectByKey
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Config_model_SelectByKeyyoutube.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Config_model.php
Line: 42
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 132
Function: SelectByKey
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Config_model_SelectByKeyapp_id.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Config_model.php
Line: 42
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 133
Function: SelectByKey
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Config_model_SelectByKeybanner_home.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Config_model.php
Line: 42
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 136
Function: SelectByKey
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: unlink(/home/anhtest2/public_html/application/cache/Config_model_SelectByKeybanner_footer.cache): No such file or directory
Filename: drivers/Cache_file.php
Line Number: 279
Backtrace:
File: /home/anhtest2/public_html/application/core/MY_Model.php
Line: 25
Function: get
File: /home/anhtest2/public_html/application/models/Config_model.php
Line: 42
Function: query_cache
File: /home/anhtest2/public_html/application/core/MY_Controller.php
Line: 137
Function: SelectByKey
File: /home/anhtest2/public_html/application/controllers/frontend/Post.php
Line: 9
Function: __construct
File: /home/anhtest2/public_html/index.php
Line: 315
Function: require_once
[Selenium Java] Bài 25: Khởi chạy Browser tùy chọn (multi browser) | Anh Tester
Nội
dung bài học
Khởi chạy Browser tùy chỉnh (multi browser) không cần chạy bên file XML
BaseSetup.class
public WebDriver setupDriver(String browserType) {
switch (browserType.trim().toLowerCase()) {
case "chrome":
driver = initChromeDriver();
break;
case "firefox":
driver = initFirefoxDriver();
break;
case "opera":
driver = initOperaDriver();
break;
case "edge":
driver = initEdgeDriver();
break;
default:
System.out.println("Browser: " + browserType + " is invalid, Launching Chrome as browser of choice...");
driver = initChromeDriver();
}
return driver;
}
private WebDriver initChromeDriver() {
System.out.println("Launching Chrome browser...");
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
return driver;
}
private WebDriver initEdgeDriver() {
System.out.println("Launching Edge browser...");
WebDriverManager.edgedriver().setup();
driver = new EdgeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
return driver;
}
private WebDriver initFirefoxDriver() {
System.out.println("Launching Firefox browser...");
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
return driver;
}
private WebDriver initOperaDriver() {
System.out.println("Launching Opera browser...");
WebDriverManager.operadriver().setup();
driver = new OperaDriver();
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
return driver;
}
Gọi lại
driver = new BaseSetup().setupDriver("opera");

Cộng đồng Automation Testing Việt Nam
🌱 Facebook
Fanpage: Anh Tester
🌱
Telegram Automation Testing:
Cộng đồng Automation Testing
🌱 Facebook Group Automation:
Cộng đồng Automation
Testing Việt Nam
🌱
Telegram Manual Testing:
Cộng đồng Manual Testing
🌱 Facebook
Group Manual:
Cộng đồng Manual Testing Việt Nam
Chia sẻ kiến thức lên trang
Bạn có thể đăng bài để chia sẻ kiến thức, bài viết
của chính bạn lên trang Anh Tester Blog
Anh Tester
facebook.com/anhtester
Đường dẫu khó chân vẫn cần bước đi
Đời dẫu khổ tâm vẫn cần nghĩ thấu