Skip to content

Commit

Permalink
fix(appium): error when saving screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Jan 17, 2025
1 parent cb22be8 commit 153012c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/helper/WebDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,13 @@ class WebDriver extends Helper {

const originalWindowSize = await this.browser.getWindowSize()

// this case running on device, so we could not set the windowSize
if (this.browser.isMobile) {
this.debug(`Screenshot has been saved to ${outputFile}, size: ${originalWindowSize.width}x${originalWindowSize.height}`)
const buffer = await this.browser.saveScreenshot(outputFile)
return buffer
}

let { width, height } = await this.browser
.execute(function () {
return {
Expand Down

0 comments on commit 153012c

Please sign in to comment.