简体   繁体   English

无法使用 codeceptjs 单击元素

[英]Unable to click on an element using codeceptjs

enter image description here I have tried below approaches to click on an element but unable to click and always click in the background of the page:-在此处输入图像描述我尝试了以下方法来单击元素但无法单击并始终在页面背景中单击:-

Using css:使用CSS:

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

Also tried xpath.也试过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.注意:如果浏览器大小没有最大化,它工作正常。

I went through the same situation.我也经历过同样的情况。 I used to use xpath this way:我曾经这样使用 xpath:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM