我在打开网站时遇到了有关 Selenium Webdriver 速度的令人厌恶的问题。
我正在测试的网站是内部网站,因此您无法访问。为了详细描述我的问题,我将将该网站称为ABC。
当我ABC在 Chrome 浏览器中输入 的 URL 时,只需要 1 秒钟即可打开该网站。
在 TestNG 中,我的 Selenium 客户端如下所示:
String ABC = "ABC'S URL";
String chromeDriverPath = "C:\\selenium\\chromedriver.exe" ;
System.out.println("start selenium");
File file = new File(chromeDriverPath);
System.setProperty("webdriver.chrome.driver",file.getAbsolutePath());
ChromeOptions options = new ChromeOptions();
options.addArguments("--start-maximized");
webDriver driver = new ChromeDriver(options);
driver.get(ABC);
Run Code Online (Sandbox Code Playgroud)
然后,Chrome将由自动化测试软件控制。在足迹上,会有一个注释,写着waiting for staticxx.fackbook.com, 或waiting for www.facebook.com。
1分钟后,ABC网站已成功加载。我检查F12工具并在控制台中显示staticxx.facebook.com/connect/xd_arbiter/r/0F7S7QWJ0Ac.js?version=42#channel=f38f3479a8af658&origin=http%
Failed to load resource: the server responded with a status of 503 …