I am having issues when trying to create a function inside of a constructor. The function doesn't seem to understand variables that are also initialized inside of the constructor.
I need the variables and functions inside of the class.
Here is some sample code
class dLoginPage {
constructor() {
this.Username = Aliases.browser.page_General_Login.formLoginform.textboxUsernameinput;
this.Password = Aliases.browser.page_General_Login.formLoginform.passwordboxPasswordinput;
this.SubmitButton = Aliases.browser.page_General_Login.formLoginform.submitbuttonLogin;
this.Login = function() {
this.Username.SetText("admin");
this.Password.SetText("admin");
this.SubmitButton.ClickButton();
}
}
}
module.exports = dLoginPage;
When I try running the login function, it states that username and password and submitbutton have not been initialized. But if i take the login function outside of the class, everything works. But i need the function inside of the class.