1.Here是HTML代碼>如何使用量角器選擇第一個建議的元素?
<div *ngFor="let profile of matchingProfiles" (click)="selectAlias(profile)" class="profile">
<img [src]="profile.profilePhotoBase64" class="alias-search-profile-image"/><p id="alias-search-text" class="alias-search-profile-text">{{ profile.alias }}</p></div>
2.here是我的代碼:
element(by.id('ugcshare-textbox')).sendKeys('@mshinagi');
browser.explore();
element(by.id('alias-search-text')).get(0).click();
browser.sleep(2000);
element(by.id('share-submit')).click();
- 錯誤:我收到錯誤爲「類型錯誤:元件(...)。得到的是不是一個函數「enter image description here
我要選擇我雖然從指數試圖被顯示在image.Even第一個建議,但我unsuccessful.Could有人請幫助我。
by.id返回單個項目,因爲id應該是唯一的。使用返回項目列表的東西。 – toskv