C
C
Che_Bu_Rashka2017-05-12 12:41:27
Java
Che_Bu_Rashka, 2017-05-12 12:41:27

How to force Selenium not to take a screenshot?

Everyone writes how to take a screenshot. And I need to force Selenium not to take screenshots when an Exception happens. After all, whenever Ecxeption occurs, he makes a screen.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Eremin, 2017-05-12
@EreminD

see where the driver is initialized. The ability to screenshot is configured there.
Well, look in the error handler, there the screenshot itself takes place
. Well, this is so, without seeing the code

C
Che_Bu_Rashka, 2017-05-15
@Che_Bu_Rashka

there is such an option,
but it does not work ...
in the logs, I look, it still remains enabled

ChromeOptions options = new ChromeOptions();
        options.setBinary(<путь до бинарника>);
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        capabilities.setCapability(ChromeOptions.CAPABILITY, options);
        //откл скриншоты при Exception  
        capabilities.setCapability("takesScreenshot", false);

        WebDriver driver = new ChromeDriver(capabilities);

       // и я еще использую библу от "селенид"
        WebDriverRunner.setWebDriver(driver);

Who knows?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question