javascript - Element not found when following the page object style guide -


as per my previous question creating question. followed guidelines in style guide when told, elements not found on page.

in pageobject, have defined fields , get-function. when perform get-function, chrome still on blank page because it's start of test. before performing get-function, protractor seems want initialize fields have declared, throwing no element found exception.

does have experience this? can't seem head around it.

i suspect problem might come this part of style guide - if making actions on found in page object constructor elements right there in page object constructor - need put page object initializations beforeeach() instead of having them directly under describe:

var userpropertiespage = require('./user-properties-page'); var menupage = require('./menu-page'); var footerpage = require('./footer-page');  describe('user properties page', function() {   var userproperties,       menu,       footer;    beforeeach(function () {     userproperties = new userpropertiespage();     menu = new menupage();     footer = new footerpage();   });    // specs });  

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -