Open kkrishan opened 6 years ago
I've been having the same issues regarding not being able to delete httpOnly cookies. A very hacky workaround is restarting the browser when you want to remove the cookies. Make sure to also initiate the elements on your page again when you do this (move the loginPage = new LoginPage() etc. into a Before block). https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/5101 says that it's impossible so for now this might be the best we have.
Issue : not able to delete httpOnly:true , secure: true cookie using browser.driver.manage().deleteAllCookies() in headless chrome in protractor in docker.
Able to do same in my local setup : windows > protractor > chrome
Setup : protractor 5.3.2 , chromedriverVersion: '2.37.544315 , chrome 'version' => '66.0.3359.117', platform=Linux 3.10.0-862.3.2.el7.x86_64 x86_64) . Docker image : node:9-stretch.
Docker file options:
args "-v /tmp:/tmp --privileged --net=host --shm-size=2gb" Chrome options :
args: ['no-sandbox','headless','disable-gpu','window-size=1366,768'], Code sample :
}); Stackoverflow - link
Original problem started with logout failure in our application using automation . On clicking logout button , a pop up appears with logout url (anchor element with href) , On clicking that element , logout happens (i.e redirection to several urls through UAA and ultimately landing on login page again). Behind the scene probably clearing auth cookie it seems or invalidating the session or cookie. Last week clicking on the logout anchor element started failing with failure on clicking . protarctor session simply times out on click
so initial thoughts were that click is failing , and i tried using browser.get('app_url/logout') instead of directly clicking on link . This too times out . I have verified that browser.get() works fine for change in hash or different url in docker setup.(earlier their was a issue logged in chrome <65 ) . I also verified that click on link works fine , its not a click problem
I feel that the issue is when app tries to clear cookies , the protractor session hangs their and times out while in docker setup . All this works absolutely fine in my local machine (windows). While digging in this issue , i found out that cookies are not getting cleared in docker for same protractor code , while in local they get cleared