質問

Suppose a simple http://mypage.com/ returns the following HTML:

<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src="mypage.js"></script>
</head>
<body>
    <h3>Hello World!</h3>
</body>
</html>

So when I issue a Selenium WebDriver.get("http://mypage.com") command, the webdriver will attempt to load my page along with its 'mypage.js'.

My question is: does the WebDriver go through the same "infrastructure" (i.e., the selenium-**webdriver** code) to also download 'mypage.js' or is that already handled separately/innately just by the browser instance that comes up, completely independently of any WebDriver code?

役に立ちましたか?

解決

The Selenium WebDriver controls the browser and does exactly what the browser would do if you were accessing that page. There will be no difference in loading the JavaScript using the WebDriver.

The Selenium website says:

The biggest change in Selenium recently has been the inclusion of the WebDriver API. Driving a browser natively as a user would (...)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top