WD
|
Session contains map of ViewId to ViewHandle. View enumerator can update this map. It adds new views and removes closed. For each view type there should be separated view enumerator - class derived from webdriver::AbstractViewEnumeratorImpl. Custom AbstractViewEnumeratorImpl has only one virtual method EnumerateViews() that returns all found view of specific types.
Example of usage:
For separating session and view commands executor concept is used. webdriver::ViewCmdExecutor is pure virtual class that represents all actions that can be done on single view of specific type in one session. So for each view type there should be separated view executor implemented by customer. Exexcutor can be created only by webdriver::ViewCmdExecutorCreator which knows if it can create executor for passed view. All executor creators are registered in webdriver::ViewCmdExecutorFactory. This singleton is an entry point to get executor for view.
Example of registration:
Each type of view should have own factory, class derived from webdriver::ViewCreator. Factory for single view type should be registered in singleton - webdriver::ViewFactory. View can be created by two methods:
CreateViewByClassName() and CreateViewForUrl() return ViewHandles. But these handles are not registered in session. User can register them manually or use view enumerator. After enumerating action all view created but not registered will be added to session's views map automatically.
Example of configuration:
Session contains map of ViewId to ViewHandle. webdriver::ViewHandle is abstraction intended to keep reference to real window implementation(ie pointer to QWidget). Customizer should implement this abstract class.
Example of custom implementation: