Forum Discussion

nedbacan's avatar
nedbacan
Frequent Contributor
2 years ago

How to run a TestComplete test between mutiple instance of Chrome using different user profile

Hello.

In Test Complete, Is it possible to open two instances of Chrome at the same time using different user profile, and executing the tests between both profiles?

 

The reason of my question is that I have the following manual test case I would like to automate using 2 chrome sessions running at the same time. It is important for both Chromes not to use the same user profile.

 

             1) Launch Chrome (1) using profile(1)

  •     2) On Chrome (1) - Log on as user1 onto the web app.
  •     3) On Chrome (1) - Create a patient and assign patient to user 2.
  •     4) On Chrome (1) - Make the call for user2 to accept the patient.
  • 5) Start another session of Chrome, but with profile (2) and keeping the other session of Chrome(1) opened.
  •     6) On Chrome (2) - Log on as user2
  •    7) On Chrome (2) - Check patient is in user 2 list.
  •    8. On Chrome (2) - Accept user 1 call and perform a few actions.
  •    9) On Chrome (2) - user 2 return patient to user1
  • 10) Return to Chrome (1) 
  • 11) On Chrome (1) - User 1 ends the patient visit after a few actions
  • 12) Both users logs out.
  •  
  • I hope someone can help explain how it can be done by example. 

Thank you.

  • To nedbacan :

     

    rraghvani wrote: "I've defined two alias name mappings for each of the two browsers."

    Actually, you are not required to create two aliases because this will duplicate child objects hierarchy with seems to be identical otherwise.

    The task that you must solve is: you must configure alias for the browser and/or for the displayed page so that it becomes possible to distinguish between them during runtime.

    As an example, you may use process index to distinguish between two browsers.

    To do this:

    -- Create, for example, temporary project variable called iBrowserIndex;

    -- Edit identification parameters for the browser object in NameMapping so that they (parameters) include process index property and set iBrowserIndex variable as a value for this property;

    -- Now, during runtime, start first browser, get a reference to its process (using 

    Browsers.CurrentBrowser call, for example) and store somewhere the value of its process index;

    -- Start second browser and also store the value of its process index;

    -- Now, depending on with what browser your test code needs to work, assign the value of the stored process index to the iBrowserIndex variable.

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    The screenshots you have provided for Chrome 1 and 2, the properties are exactly the same. Therefore TC can't distinguish between the two objects you are referring too.

     

    You must instruct TC, as to what browser you want to interact with.

    The objects have two different parents i.e. browser