mardi 24 novembre 2015

For Page Object Pattern, when designing the page objects in Selenium, how do you handle multiple modals correctly?

Let me further explain. You have a page where an application lives. However, upon first login, the user is prompted with a welcome screen that loads in the center of the browser. Like a pop-up from the application. This welcome screen is to help the user get familiar with the app. You can move on through the screens by reading the information and clicking the Continue button. After several of these pop-ups, the application will now be available for testing.

So how would I handle this in the Page Object Pattern using Selenium. Should I have a main page that just has functionality to navigate through these modals? Or should the main page return objects that represent each of the individual modals? Or should each modal be a separate page that I interact with?

Basically, I can think of several options:

ApplicationPage.Modal1.Continue();

or

Modal1.Continue(); Modal2.Continue();

or

ApplicationPage.ContinueThroughModal1();

or

ModalPage.Continue1(); ModalPage.Continue2();

Aucun commentaire:

Enregistrer un commentaire