D.A. Perokovic D.A. Perokovic -4 years ago 109
Java Question

screenshot part of web using selenium webdriver

is it possible to capture a specific part of a web ui (like using the image's coordintes?) using selenium web driver? I'm using java to write my script. Thanks

Answer Source

Just want to share how I've resolved this issue using Multiscreenshot jar. Thanks.

import multiScreenShot.MultiScreenShot; 

WebElement object1 = driver.findElement(By.Id("MyObject"));
MultiScreenShot multiScreens = new MultiScreenShot("C:\\", "test"); // Path where you save the image
multiScreens.elementScreenShot(driver, object1);
WebElement object2 = driver.findElement(By.Id("YourObject"));
multiScreens.elementScreenShot(driver, object2);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download