Facebook \ WebDriver \ Exception \ NoSuchElementException:否这样的元素:无法找到元素

时间:2019-05-22 13:12:42

标签: php laravel-5 automated-tests laravel-dusk laravel-dusk2

我有此代码

@forelse($companies as $company)
             <div class="custom-control custom-radio">
                  <div class="form-check">
                        <input class="custom-control-input" type="radio" id="company-{{$company->id}}" value="{{$company->id}}" name="company_id" >
                          <label class="custom-control-label" for="company-{{$company->id}}">
                                            {{$company->name}}
                                        </label>
                                    </div>
                                </div>

我如何使用laravel黄昏进行测试??? 我尝试过了

      $emailparts=explode('@',$userEmail);
      $companies=Company::select('companies.*')->whereRaw("SUBSTRING_INDEX(companies.email,'@',-1)='{$emailparts[1]}'")->get();
                ->select("company-".$companies->random()->id)

但是它给了我这个错误

Facebook\WebDriver\Exception\NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"body select[name='company-16']"}

如何修复它?

0 个答案:

没有答案