Unable to click on an element using codeceptjs

1k views Asked by At

enter image description hereI have tried below approaches to click on an element but unable to click and always click in the background of the page:-

Using css:

submitButtonEnabled: { css: 'button.button--enabled[type="submit"]' },
I.click(this.submitButtonEnabled);

Also tried xpath. and

I.click('Submit',this.submitButtonEnabled); or I.click("Submit");

Also tried within keyword like :

within({css:'div.scrollable.panel__scrollable'},()=>{
      I.click('Submit',this.submitButtonEnabled);

}); 

Notes: Its working fine if browser size is not maximized.

1

There are 1 answers

0
saadi chouaib On

I went through the same situation. I used to use xpath this way:

I.click('//button[@type="submit"]');