I use IWebDriver driver = new ChromeDriver(options)
in C#
When I take .GetScreenshot();
, often see scrollbar, is there a way to remove it?
2nd question, how to mock/change http_agent
in ChromeDriver?
Chrome DevTools: Scroll elements into the viewportRight click on the DOM node from the elements panel. Select Scroll into view.
Remove scrollbars by adding the tag "scrolling=no." Remove borders by adding the tag "frameborder=0."
Scrollbar issue:
chrome://flags/
in Chrome.user_data/Default/User StyleSheets/Custom.css
similar to the one below and launch Chrome with {--user-data-dir=user_data}Custom.css:
::-webkit-scrollbar {
height: 10px;
width: 10px;
background-color: #999999;
display: none;
}
html > ::-webkit-scrollbar {
width: 0px;
display: none;
}
::-webkit-scrollbar-thumb {
background: #999999;
display: none;
}
::-webkit-scrollbar-track-piece {
background-color: #797979;
display: none;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With