A Context refers to the state of an application, and it presents specific actions a user can take to accomplish a use case on the system.
In the simplest form, you can consider each page of your web application to be a Context. Examples include Home Page, Login Page, Search Page, Search Results Page, Payment Info Page, etc.
Visual rendering of a Context (or page) is captured in the form of a View. Most commonly you may have one View for each Context/page. However, it is also possible that some pages need multiple views.
So the question is, when is a new view warranted? Sometimes, a page may expose a set of new UI controls upon some action on the page. Examples could include
- Opening up of a calendar control when you click in date field
- Opening up a doormat menu when you hover on top toolbar
- Showing more-search options, when you click on "Advanced Options" link
- A small popover or popup that may come up with additional details on the page etc.
These controls (calendar, doormat menu, etc.) may not be visible in the default view you take for the page. In case your test logic requires you to interact with these controls, you will be required to capture another view with the necessary UI controls visible.
Note: It is important that you do not create multiple Contexts in such situations. Functionally all these Views are related for the page functionality.
Notice that clicking or hovering on the fields in the green border results in new elements presented on the screen, necessitating a new View.
Note: New view will be required ONLY if your action logic needs to perform any interaction with the elements that the view will bring.
Note: You do not need to capture multiple Views just to with data difference on pages. For example, when you are looking at the Flight Search Results page, you may see different data every time. This does not require capturing a new view.
When you need additional View for a Context, simply navigate to the Views panel in either a Context or an Action and add it to the existing list.