无法理解为什么我收到codecept错误

问题描述 投票:-2回答:1

我正在编写一个小型测试程序,我想要登录表单并填写它。但是,我收到一个错误。 enter image description here

这是我在我的代码中得到的:

<?php

class loginCest
{
    public function frontpageWorks(AcceptanceTester $I)
    {

        $I->wantTo("Create login test");
        $I->amOnPage('my link');
        $I->see("join");
        $I->fillField('.form-control', 'my_login');
    }
}
php testing automated-tests codeception
1个回答
0
投票

我会尝试使用严格的定位器,例如:

$I->fillField(['name' => 'userIdentifier'], 'my_login');

因为代码概念可能会找到类.form-control的多个元素(甚至是非输入元素)

© www.soinside.com 2019 - 2024. All rights reserved.