Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testcafe can see button but not click on it

In a testcafe test how can I click on an element that is clearly clickable (with t.debug() I'm able to click on the element) and visible without using ClientFunction, or t.eval -- these "workarounds" recommended in testcafe's github issues do not work.

Some additional considerations:

  • the code I'm testing is Angular 1.7.
  • the Selector is verified as correct (and I tried various types of selectors)
  • testcafe version 1.8.4
  • I've tried various t.wait times before and after selection and click
  • I've tried changing the element type (<button> to <div>, etc)
like image 609
sjt003 Avatar asked Apr 17 '20 15:04

sjt003


1 Answers

Try waiting for the element to be visible before clicking

await element.with({ visibilityCheck: true }).with({timeout: 10000});
like image 135
VysakhMohan Avatar answered Sep 21 '22 04:09

VysakhMohan