Skip to content

Commit

Permalink
(webdriver): don't retry 'move target out of bounds' errors - fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Mar 5, 2024
1 parent bbbbece commit ed2bd48
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/webdriver/src/request/index.ts
Expand Up @@ -294,8 +294,8 @@ export default abstract class WebDriverRequest extends EventEmitter {
}

/**
* stop retrying as this will never be successful.
* we will handle this at the elementErrorHandler
* stop retrying as this will never be successful.
* we will handle this at the elementErrorHandler
*/
if (error.name === 'stale element reference') {
log.warn('Request encountered a stale element - terminating request')
Expand All @@ -304,6 +304,14 @@ export default abstract class WebDriverRequest extends EventEmitter {
throw error
}

/**
* Move out of bounds errors can be excluded from the request retry mechanism as
* it likely does not changes anything and the error is handled within the command.
*/
if (error.name === 'move target out of bounds') {
throw error
}

return retry(error, `Request failed with status ${response.statusCode} due to ${error.message}`)
}
}
Expand Down

0 comments on commit ed2bd48

Please sign in to comment.