0
it('login page', function() {
browser.driver.get('url');
browser.driver.findElement(by.name('j_username')).sendKeys('admin');
//browser.driver.sleep(4000);
browser.driver.findElement(by.name('j_password')).sendKeys('admin');
browser.driver.findElement(by.className('btn-sign-in')).click();
});
我可以成功地運行上面的代碼,但是當我用這個作爲 -我不能夠使用元件或browser.get命令(使用Windows 7)
it('login page', function() {
browser..get('url');
element(by.name('j_username')).sendKeys('admin');
element(by.name('j_password')).sendKeys('admin');
element(by.className('btn-sign-in')).click();
});
我不能夠運行。
同樣,當我嘗試在elementexplorer.js使用它,這是行不通的 -
> element(by.id('username'))
{ click: [Function],
sendKeys: [Function],
getTagName: [Function],
getCssValue: [Function],
getAttribute: [Function],
getText: [Function],
getSize: [Function],
getLocation: [Function],
isEnabled: [Function],
isSelected: [Function],
submit: [Function],
clear: [Function],
isDisplayed: [Function],
getOuterHtml: [Function],
getInnerHtml: [Function],
findElements: [Function],
isElementPresent: [Function],
evaluate: [Function],
'$$': [Function],
findElement: [Function],
find: [Function],
isPresent: [Function],
element: { [Function] all: [Function] },
'$': [Function] }
這意味着這不是在它的工作也是如此。
您是否收到錯誤訊息?你在'browser.get('url');'(double point)而不是'browser.get('url');' – glepretre
'有一個錯字,對不起,這是我的錯字,它正確地寫在我的實際代碼中。 –
沒問題;)你得到哪個錯誤? – glepretre