Fix setAttribute() and sendEvent() method chaining