2014-05-23 13 views
3

在codeception中的fillField方法不工作拋出DOMXPath :: query():無效的表達式

$ I-> fillField(「username」,「test」);

在運行驗收試驗,得到以下錯誤:

對不起,我不能填補領域 「用戶名」, 「測試」: ErrorException:DOMXPath ::查詢():無效的表達

輸入元素在表單內。我嘗試添加id到輸入,並使用inpu訪問元素..但所有返回相同的錯誤。 「看到」方法正在工作..但不fillField或seeInField。

+1

同probleme。我今天做了作曲家更新 – Arnaud

+0

請參閱:https://github.com/Codeception/Codeception/issues/1035&& https://github.com/symfony/symfony/pull/10987 – exiquio

回答

0

你必須告訴codeception它看起來什麼元素。

如果用戶名是一個id做:

$I->fillField("#username", "test"); 

並且如果類做:

$I->fillField(".username", "test"); 

或輸入元件的xpath的:(例如搜索字段在google.com)

$I->fillfield('//*[@id="gbqfq"]','my search text test'); 
相關問題