protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Writing Page Objects in Protractor - Is this Implementation Correct

Open mangeshkhaire14 opened this issue 7 years ago • 2 comments

Hi,

I have come with this kind of implemention for page objects but i don't know whether this is correct or not but its working file. I am not expert in node js programming but I want to know that will all page elements will be initialised or it will find the elements as an when constructor loads or will it find when actual operatios on that elements will be performed. please provide suggestion on this

var emailTextBox='[name="login_email"]'; var passwordTextBox='[name="login_password"]'; var signInButton="button>.signin-text";

class SignInPage{

constructor(){
    this.emailTextBox=element(by.css(emailTextBox));
    this.passwordTextBox=element(by.css(passwordTextBox));
    this.signInButton=element(by.css(signInButton));

mangeshkhaire14 avatar Feb 27 '19 05:02 mangeshkhaire14

@mangeshkhaire14 , Please post questions in gitter or StackOverflow

jithinkmatthew avatar Feb 27 '19 06:02 jithinkmatthew

@jithinkmatthew Ok

mangeshkhaire14 avatar Feb 27 '19 08:02 mangeshkhaire14