bitovi / bitovi/syn

Not possible to run click() in a try catch

Open
#107 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
441
Forks
254
PR merge metrics
No merged PRs in 30d

Description

If you have a click handler that throws an exception there's no way to capture this:

``` js
try {
syn.click(element);
} catch(err) {
// handle the error
}
```

It is because a setTimeout is used because of an IE bug: https://github.com/bitovi/syn/blob/master/src/synthetic.js#L811

Perhaps there should be an option `catchExceptions` that catches them and calls the callback with an error object.

Contributor guide

Open the contributing guide

Research direction

Read src/synthetic.js around line 811 to understand the setTimeout workaround for the IE bug. Trace syn.click(element)'s callback path and determine how the proposed catchExceptions option should report handler exceptions; done means the callback receives an error object while existing click behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.