こんにちは私は「角度4」アプリケーション用の分度器自動化スクリプトを作成しています。「分度器」を使用して「要素」の「テキスト」を取得できません
開発コードは以下のとおりです。
<!--Byndd Title div-->
<div class="ui-g-12 ui-md-8 ui-lg-10">
<div class="bynndTitleClass" i18n="@@introductionBynddHeader">
BynddYour Information Together And CONNECT to the world in an EFFICIENT way
</div>
</div>
私の分度器のテストスクリプトは以下の通りです。
ページオブジェクトコード:
//to return login page heading
getLoginPageMainHeading(){
return element(by.css('div[class="bynndTitleClass"]')).getText();
}
仕様コード:
//Testcase1 : To open the "Login page" of the application
it('should open the Login page' ,()=>{
//To open the Login page
page.loginPageDisplay();
// to verify whether the Current page is Login page or not by comparing with Login page Main heading
expect(page.getLoginPageMainHeading().toString()).toBe('BynddYour Information Together And CONNECT to the world in an EFFICIENT way');
});
実行後、エラーメッセージの下に表示されています。
1) should test certificate tab should open the Login page
- Expected '[object Object]' to be 'BynddYour Information Together And CONNECT to the world in an EFFICIENT way'.
W は、誰もがこの問題に
@Emstツウィングリはあなたの返事に感謝します。 SpecとPoのファイルコードに変更しましたが、それでも同じエラーが表示されています。 コメントに記載されている上記のコードを使用して解決します。 – vasundhara