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
Post a Comment