Answer the question
In order to leave comments, you need to log in
How to disable screenshots in Selenium?
There is a code in which I configure (capabilities) not to take a screenshot before starting WedDriver.
System.setProperty("webdriver.chrome.driver", Config.getWebdriver());
ChromeOptions options = new ChromeOptions();
options.setBinary(Config.getBrowser());
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
capabilities.setCapability("takesScreenshot", false);
WebDriver driver = new ChromeDriver(capabilities);
driver.get(Config.getURL());
// какой-то код
........
Capabilities [{
applicationCacheEnabled=false,
rotatable=false,
mobileEmulationEnabled=false,
networkConnectionEnabled=false,
chrome={chromedriverVersion=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),userDataDir=/tmp/.org.chromium.Chromium.2MzIvi},
takesHeapSnapshot=true,
pageLoadStrategy=normal,
databaseEnabled=false,
handlesAlerts=true,
hasTouchScreen=false,
version=58.0.3029.96,
platform=LINUX,
browserConnectionEnabled=false,
nativeEvents=true,
acceptSslCerts=true,
locationContextEnabled=true,
webStorageEnabled=true,
browserName=chrome,
takesScreenshot=true,
javascriptEnabled=true,
cssSelectorsEnabled=true,
unexpectedAlertBehaviour=}]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question