I am completely new to using protractor for testing .NET Applications. I am currently in the process of creating an automation testing script from scratch. The following is the HTML code:
<div class = "top">
<span id = "welcome">
<em>Hi</em>
","
<strong>
<span id = "user">MyName</span></strong>
"|"
</span>'
The protractor code that I am working with is as follows:
var greet = element(by.id('user')); expect(greet.getText()).toBe('MyName');
In addition to the above, I have also implemented this code:
var greet = element(by.id('welcome')).element(by.id('user'));
expect(greet.getText()).toBe('Hi, MyName'); // or toEqual("Hi, MyName");
Despite my efforts, I keep encountering error messages such as:
Failed: No element found using locator: by.id("welcome")
or
Failed: No element found using locator: by.id("user")
I am looking for advice and guidance from experienced protractor testers.