c# - WebDriver take screenshot out of screenbounds -
i trying use webdriver save away image of in dom, of items may 1500px+ in height. , taking screenshot of doesn't @ best can 1080. when in testing may lower.
i have tried researching , finding ways of doing of day, , thought had found trick
var element = findelement(by.classname("contentbody")); int width = element.size.width; int height = element.size.height; point point = element.location; int x = point.x; int y = point.y; rectanglef part = new rectanglef(x, y, width, height); bitmap bmpobj = new bitmap((int)part.width, (int)part.height); bitmap bn = bmpobj.clone(part, bmpobj.pixelformat); bn.save(path, imageformat.png);
however getting outofmemory exception when cloning rectangle across. in particular example element div bounds 1220 x 3045 (it list of items) , save away comparisons later.
if has idea how solve appreciated.
Comments
Post a Comment