Skip to content

Do we need to driver.switchTo().defaultContent(); before take screenshot? #321

@shenlian8

Description

@shenlian8

Hi,

I'd like to ask, in Runner class, do we need in takeScreenshot(File file, boolean entirePage) methode the block any more?

    try {
        // cf. http://prospire-developers.blogspot.jp/2013/12/selenium-webdriver-tips.html (Japanese)
        driver.switchTo().defaultContent();
    } catch (Exception e) {
        // some times switching to default context throws exceptions like:
        // Method threw 'org.openqa.selenium.UnhandledAlertException' exception.
    }

Thanks!

Best regards

Lian

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions