这是我对代码接收的测试:
$I->wait(2);
$I->amOnPage('/ASTechOLE/exam-form-ng.php');
$I->wait(2);
$I->seeElement(Locator::find('div', ['id' => 'oleWaitMessage']));
您会在最后一行看到im正在检查id为“ oleWaitMessage”的div。
我的问题是,它给我一个错误,指出即使在页面中也找不到该元素。
这是我收到的错误:
1) FirstCest: Login successfully
Test tests\acceptance\FirstCest.php:loginSuccessfully
Step See element "//div[@id = 'oleWaitMessage']"
Fail Element located either by name, CSS or XPath element with '//div[@id = 'oleWaitMessage']' was not found.
Scenario Steps:
2. $I->seeElement("//div[@id = 'oleWaitMessage']") at tests\acceptance\FirstCest.php:34
1. $I->amOnPage("/ASTechOLE/exam-form-ng.php") at tests\acceptance\FirstCest.php:31
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
这是一个截图,显示它实际上在我的页面中:
https://gyazo.com/92e8773f1136fba15cbf3693f8ca039c
我还尝试查找实际的“请稍候...”文本,但也没有找到