I'm trying to test a scenario where two separate users are logged in. As the question states, is this possible with Selenium? I don't if it's browser dependent, but I'm using Chrome.
Selenium (web driver) allows to open several browser windows (e.g. 3 Firefox windows or 1 IE + 1 Firefox +1 Chrome).
In you code you have API to select the desired window (depending how on how you opened it).
Regarding the session handling: that depends on the browser type. Firefox will share the session across multiple windows because it's using a single process. AFAIK IE and Chrome if opened as new processes will not share it, but this of course depends also on how the server is setting the cookie policy for the session. Access to cookie values in the browser however is domain dependent, so a persistent cookies or local storage can share information even across sessions, so it really depends on how the web application is implemented (or what framework is using - that mostly takes care of such stuff).
If you want complete separation, then take a look at Selenium Grid;https://code.google.com/p/selenium/wiki/Grid2
This would allow you to have the browsers open on different computers while running the test on one machine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With