問(wèn)題描述
在 Protractor API 文檔之后應(yīng)該有是一種截取整個(gè)頁(yè)面的方法,而不僅僅是可見(jiàn)的框架.事實(shí)上它應(yīng)該是默認(rèn)行為.
Following Protractor API documentation there should be a way to take screenshot of entire page, not only visible frame. In fact it should be default behaviour.
當(dāng) takeScreenshot()
被調(diào)用時(shí)
browser.takeScreenshot().then(function (png) {
// writing down image
});
然后在文件中保存選項(xiàng) 3.來(lái)自文檔 - '當(dāng)前幀的可見(jiàn)部分'.如何強(qiáng)制webdriver全屏截圖?
Then in file is saved option 3. from documentation - 'Visible portion of current frame'. How to force webdriver to take full page screenshot?
推薦答案
chrome 上有個(gè)bug.https://bugs.chromium.org/p/chromium/issues/detail?id=45209https://bugs.chromium.org/p/chromedriver/issues/detail?id=294
更改瀏覽器高度后(browser.driver.manage().window().setSize(320, 2000);
),F(xiàn)irefox 會(huì)截取整個(gè)頁(yè)面,Chrome 不會(huì).
there is a bug on chrome.
https://bugs.chromium.org/p/chromium/issues/detail?id=45209
https://bugs.chromium.org/p/chromedriver/issues/detail?id=294
After change browser height(browser.driver.manage().window().setSize(320, 2000);
), Firefox will take entire page screenshot, but not Chrome.
這篇關(guān)于如何在量角器中截取整個(gè)頁(yè)面的屏幕截圖?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!