5

Am working on a banking application. Our requirement is to execute tests in parallel in one system.

A) Below is how our application responds to selenium parallel execution :-

  • Does not allow multiple logins in IE

  • Allows multiple logins in chrome and FF [During automation we create new profile every time, so I presume that selenium creates new browser profile every time ]

We are able to execute tests in parallel using firefox and chrome without any session issues.But while executing on IE our application logs out from the second instance automatically.. I have tried launching IE in private mode using below IE capabilities , But still facing problem in IE

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();  
    capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);  
    сapabilities.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
    InternetExplorerDriver driver = new InternetExplorerDriver(capabilities); 

Manually if you launch two IE in private mode with two different logins, it is working fine, Am getting issue only when automating via selenium.

We are using our inhouse framework for running multiple instance. we are not using testng or other unit testing frameworks

Could you please help me over come this IE session issue?

Please let me know if you need more details..

Thanks in advance..

EDIT:-

Below link says lot about how to design application not to share sessions between tabs...But I did not found any solution for my issue..

https://social.msdn.microsoft.com/Forums/ie/en-US/bcd9b000-8c14-4d91-9aac-3e258a11557d/how-to-prevent-session-sharing-across-ie-tabs?forum=iewebdevelopment

  • 2
    fyi in other browsers subsequent incognite/private windows still share cookies with the first incognito window. Many folks don't realize this. It probably has to be this was so that pop-ups and page transitions still work correctly. u may start incognito but if you use a system with a login, it will need to remember you, even in the incognito session. The assurance is that it is not a different session and can only be one. – Michael Durrant Jan 27 '17 at 14:54
1

If I remember correctly, IE shares cookies even in in-private mode.

Caveat: Mac user currently, and I have not touched IE for some time. You might want to check that with this site.

0

Maybe this will help

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
InternetExplorerDriver driver = new InternetExplorerDriver(capabilities); 
  • 1
    How does this help? – IAmMilinPatel Feb 9 '17 at 2:49
  • Thanks Frederik, I have tried all straight forward solutions :) Is there any hack we can do? – TechDog Feb 9 '17 at 6:33
0

Try using something like this (it's Ruby code but presumably you can adapt to your Java language):

before(:each) do
  caps = Selenium::WebDriver::Remote::Capabilities..internet_explorer('ie.ensureCleanSession' => true, 'ie.browserCommandLineSwitches' => 'private')
  @driver = Selenium::WebDriver.for(:internet_explorer, :desired_capabilities => caps)
  @driver.manage.window.maximize
  @base_url = "https://www.example.com/"
  @accept_next_alert = true
  @driver.manage.timeouts.implicit_wait = 30
end
  • Thank you Michael Durrant, I have tried this, But still facing the issue.... – TechDog Dec 28 '16 at 13:46
0

You will need to have multiple IE nodes in your selenium grid if you want to do this , its because IE is so tightly bound to the OS.

you can download free vm images for browser testing from here https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

then spin them up with your chosen vm host and add them to the grid then your tests can run in parallel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.