I am using Selenium Grid with TestNG to run my tests in parallel. I have certain tests that require a user to be logged in, so I have a user account configured for testing.
I have been careful to ensure that any tests involving logging in as my test user are run on separate virtual machines so that sessions are not interrupted, however after investigating some regularly failing tests it turns out that this is not enough. I therefore either need to:
Set up a new user for each test (I understand this may be the ideal solution, but it'll take some time to configure/run.
Have multiple test user accounts, and ensure that only one is used at a time.
If I could identify the host of the machine running the test I could set up test accounts accordingly. Is there any way to do this, or is there another solution that I haven't thought of?
I solved the problem of identifying the remote by putting up a "who am I page". Within my remote webdriver (or Selenium) factory, I visit that page, store it in that class I use to hold the session, and log it. This page reports Host name, IP, Browser type and version.
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