My HTML markup is all set and valid. While using WebStorm to debug my test cases, I am able to view this specific element without any issues...
<a id="privacyPolicy1234" on-tap="goPrivacyPolicy()" class="disable-user-behavior">Privacy Policy</a>
Despite the above successful inspection, my Jasmine test seems to be struggling to locate the same element.
it("should display a privacyPolicy ", function() {
privacyPolicyElement = element(by.id('privacyPolicy1234'));
expect(privacyPolicyElement.getText()).toContain("Privacy Policy");
However, an error keeps popping up:
Message:
NoSuchElementError: No element found using locator: By.id("privacyPolicy1234")
In an attempt to troubleshoot, I even tested it in a single line format but received a false
output when expecting true
.
expect(element(by.id('privacyPolicy1234')).isPresent()).toBe(true);