You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I seem to be stuck in the construction of page objects.
I read a lot of docs about page objects and know that they contain two things:
elements that are present on a page
functions to interact with the page
When I check example files I see that the elements are defined in the beginning of each page object.
The in the test, the pageobject is imported via require.
But the problem I see there is that the objects aren't yet present when the require happens.
Is there another way to solve this without having to do a require just when the page is loaded?
Thanks inadvance.
Regards
The text was updated successfully, but these errors were encountered:
I'm not quite clear on what your question is, but i'll attempt a quick answer. If you are using page objects in your tests they should be required and resolved when your test file is required. I'm going to assume you are talking about selecting an element on the page when your page object is required. You should not be selecting elements when your page object is required, instead wrap the selection in a function that can be invoked after protractor has started/the page is loaded.
Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)
Hello everyone,
I seem to be stuck in the construction of page objects.
I read a lot of docs about page objects and know that they contain two things:
When I check example files I see that the elements are defined in the beginning of each page object.
The in the test, the pageobject is imported via require.
But the problem I see there is that the objects aren't yet present when the require happens.
Is there another way to solve this without having to do a require just when the page is loaded?
Thanks inadvance.
Regards
The text was updated successfully, but these errors were encountered: