This question already has an answer here:
- Protractor: element.getText() returns an object and not String 3 answers
I want to write a test case in which I compare the value of an element clicked in previous page to that of an element's value in the current page.
I am using the following code -
validateText = SoftwaresUnmappedPage_POM.checkFirstSoftwareName.getText();
expect(validateText+"*").toBe(SoftwareSummary_POM.softwareName.getText());
For example - If I click on a button (ABC), then it loads a page. This page has elements indicating the element i clicked. But it displays the name as ABC*. So i want to verify if the element I clicked on and the page I am landing at is the same.
Error being caused - Expected '[object Object]' to be 'ABC'.
Can someone please help me resolve this problem? Thanks.