WD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
webdriver::SessionManager Class Reference

#include <webdriver_session_manager.h>

Public Member Functions

void Add (Session *session)
 
bool Remove (const std::string &id)
 
bool Has (const std::string &id) const
 
SessionGetSession (const std::string &id) const
 
std::map< std::string, Session * > GetSessions ()
 

Static Public Member Functions

static SessionManagerGetInstance ()
 

Friends

struct DefaultSingletonTraits< SessionManager >
 

Detailed Description

Session manager keeps track of all of the session that are currently running on the machine under test. With webdriver the user is allowed multiple instances of the browser on the same machine. So 2 sessions open would mean you would have 2 instances of chrome running under their own profiles.

Member Function Documentation

void webdriver::SessionManager::Add ( Session session)

Add previously created session to SessionManager

Parameters
sessionpointer to Session object
static SessionManager* webdriver::SessionManager::GetInstance ( )
static

Returns the singleton instance.

Session* webdriver::SessionManager::GetSession ( const std::string &  id) const

Get Session object by sessionId

Parameters
idsessionId to retrieve
Returns
pointer to Session object, NULL if not found
std::map<std::string, Session*> webdriver::SessionManager::GetSessions ( )

Get list of sessions

Returns
vector of pairs (sessionId, pointer to Session)
bool webdriver::SessionManager::Has ( const std::string &  id) const

Check if session exists

Parameters
idsessionId to check
Returns
true - exists, false - not found
bool webdriver::SessionManager::Remove ( const std::string &  id)

Remove session object referenced by sessionId

Parameters
idsessionId to remove
Returns
true - if succeed, false - if sessionId not found

Friends And Related Function Documentation

friend struct DefaultSingletonTraits< SessionManager >
friend

The documentation for this class was generated from the following file: