doumao6048 2019-05-21 13:07
浏览 169

Facebook \ WebDriver \ Exception \ ElementNotVisibleException:元素不可交互

I have to test using dusk and I have this tag for 3 times

<div class="form-group">
    <input type="email" name="email[]" class="form-control" placeholder="Enter teammate's email">
</div>
<div class="form-group">
    <input type="email" name="email[]" class="form-control" placeholder="Enter teammate's email">
</div>
<div class="form-group">
    <input type="email" name="email[]" class="form-control" placeholder="Enter teammate's email">
</div>

and I tried these to run it

->type('input[name=email[]]', $userEmail)->type('email[]', $userEmail)->type('input[type=email]', $userEmail)

but not working what is the correct one to type the email ??

  • 写回答

1条回答 默认 最新

  • doutang7415 2019-05-21 22:44
    关注

    The first option doesn't work because of the square brackets. You need to wrap the name in double quotes:

    ->type('input[name="email[]"]', $userEmail)
    

    You can also use the second option:

    ->type('email[]', $userEmail)
    

    Typing in all three inputs requires a loop:

    foreach ($browser->elements('input[name="email[]"]') as $element) {
        $element->sendKeys($userEmail);
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法