I need to automate/simulate multiple users (3 and more) logging in to their accounts of an instant messaging website and communicate with one another. We have to use Chrome browser for all users.
Here's a sample site: iceim.theice.com
I realized that, for example, if userA logs into his account using a default Chrome browser, any subsequently opened browser, when navigated to the above site, will automatically load userA's session.
I could open an incognito Chrome window, which will let userB login. But this only allows 2 user sessions, I can not use another incognito window to let userC login.
I have found a way by using a Chrome option to make multiple (3+) user login sessions available:
My question is: How to identify different Chrome browser instances?
Again, only Chrome can be used, and all users login to the same web site.
I would appreciate if someone could provide some VBScript sample.
I searched the community forums but couldn't find any useful information.
Thanks a lot.
I think you would run into instances of Ambiguous Recognition with multiple browsers open on one machine.
Would it be a more realistic test if you ran the test on each of three machines? I can see it being something like
Parameters = User, Chat1, Chat2
Login with User
Send message to Chat1
Send message to Chat2
Verify message from Chat1
Verify message from Chat2
Run that same test on three machines with different combinations in the parameters
The most reliable way is to be able to identify separate chrome windows/pages from the very start of the test. For example, it might be possible to perform an automated login into your tested application when starting browser (e.g. something like navigating to http://iceim.theice.com@user1:pwd1/) and then identify the new web page by looking for the provided user name (user1 in the above example).
If nothing like the above is possible, you may consider a kind of workaround that should work. The idea is that every new instance of Chrome will have incremented value of the window index property (in TestComplete's Object Browser). So the workflow is like that:
1. Close all Chrome instances (Chrome must be configured to not run in the background);
2. Set initial expected value of window index to '-1' (because the first window will have index of zero);
3. Start new instance of Chrome, increment the value of expected window index and search for the Chrome window with this index. Navigate to the required address and store the reference to the page to be used later in tests;
4. Repeat step 3 required number of times.
However, I would also recommend you to consider the option of the Network Suite in TestComplete (https://support.smartbear.com/viewarticle/81321/). This will leave you with only one Chrome instance on every test machine and you should be able to synchronize test actions (e.g. check for some message on machine B only after the message was posted on machine A) with the help of Synchronization Points provided by the Network Suite.
Thanks for the reply.
However I'd prefer using one machine to automate the testing since I'm not sure how hard it is to run a test to control AUTs on different machines.
Thanks for the reply.
Can you give some example scripts on your step 2 and 3? Thanks.
I did some tests and here is what I found:
After I opened multiple Chrome browsers with the "--user-data-dir=C:\temp\userxxx" option, in TestComplete Object Browser, these Chrome browsers looked the same, all were shown as
So I had no way to differentiate them. See screen shot:
As comparison, I used multiple IE browsers with "-private" option, and they could be differentiated in the Object Browser like:
Sys.Browser("iexplore"), Sys.Browser("iexplore", 2), Sys.Browser("iexplore", 3), etc.
So I could define them as different objects in my script and do tasks like loading login page, using different user ids and passwords to login, etc.
See screen shot:
As a matter of fact, I opened multiple instances of some Windows applications such as Notepad, Command prompt, all were shown in the Object Browser as differentiable ones:
It just looks odd that Chrome is treated differently when there are multiple instances.
I will look up the network suite option.
> Sys.Browser("iexplore"), Sys.Browser("iexplore", 2), Sys.Browser("iexplore", 3), etc.
Actually, I expected to see the same for Chrome as well... I cannot say what Chrome browsers are displayed just like Browser("Chrome") on your screenshot, but considering that they have different indexes (again, as per your screenshot), I would try to reference Chrome processes the same way: Sys.Browser("Chrome"), Sys.Browser("Chrome", 2), etc. Have you tried this? Does it work? If it works, than I would consider it as an Object Browser display problem and report it to Support (https://support.smartbear.com/message/?prod=TestComplete).
Yes I tried those and got "object does not exist" error for Sys.Browser("Chrome", 2).
I opened a ticket with SmartBear and they admitted this is an issue.
I think the scenario you mentioned is for multiple browser windows under one user profile, while mine needs multiple user profiles (see my earlier posting).
I still have the support ticket open with SmartBear and just had an update today saying there is no solution yet.
Interesting... Thank you for the update.
Have you considered the option of the Network Suite in TestComplete (https://support.smartbear.com/viewarticle/81321/) to sort this out?