How to fix DesiredCapabilities in Selenium 4.0

∥☆過路亽.° 提交于 2019-12-04 05:27:10

问题


I have a piece of code which sets browser name for the grid. However, DesiredCapabilities is deprecated in Selenium 4.0. How can I fix this code so that it works as the same in 4.0?

DesiredCapabilities capabilities = new DesiredCapabilities();

if (prop.getBrowser().equalsIgnoreCase("chrome")){
capabilities.setBrowserName(DesiredCapabilities.chrome().getBrowserName());
}

回答1:


For the record Selenium v4.x is still in alpha stage and yet to be released for General availability (GA) for Production purpose.

Snapshot:


Recommended Usage

The recommendation will be to continue using Selenium v3.141.59 and keep your framework adjusted to the current implementation of DesiredCapabilities class till Selenium v4.x is GAed for production use successfully completing the alpha and beta cycles.



来源:https://stackoverflow.com/questions/55844187/how-to-fix-desiredcapabilities-in-selenium-4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!