I want to automate an application for an upload process with selenium.Therefore I am using geckodriver. Right now I am doing the login site headless but I want to do the login by the user and then change to headless. Is there a way to do that or at least a work around?
There is no way to do that using the same browser instance... The headless flag is a setting passed to the browser on startup and there is no way to dynamically change that.
If the site uses cookie-based authentication, here is an alternate approach:
login with browser in normal (GUI) mode
export saved cookies
instantiate a new browser in headless mode
navigate to the site again with the headless driver
add saved cookies to the new headless driver
... at that point, you can navigate to an authenticated page. You should be "logged in" since you are re-using the cookies from the original browser session.
Related
I am trying to open a Visualforce page in Firefox using an automation tool (Web driver). While trying this, every time automated browser open the VF page it shows:
We can't display this page because your browser blocks cross-domain
cookies. Try again with a different supported browser.
How to run automation test script for the VisualForce Pages?
here's the situation: I load a website A in incognito mode using Selenium Chrome Webdriver. In this website there is a iframe loading information from website B. Chrome Incognito mode blocks the iframe contents because treats it as a 3rd party cookie.
If I allow the cookies from the website B the conents of the iframe show up. If I don't use the incognito mode the contents also show up. However, after manually allowing cookies in Chrome setting it only works during this session. And I need the incognito mode in other tests so I don't want to change configuration between the tests.
Is there a way to set up the Webdriver to allow the cookies from the 3rd party website?
I want to support window authentication pop up for login to the application using Protractor using chrome headless browser. Is there any way in which I can make it work?
I have already tried:
Chrome authentication extensions - https://www.npmjs.com/package/authenticator-browser-extension
Loading URL in the below format:
http://username:password#url.com which did not work out.
I am trying to run some automated tests on amazon.com by using Selenium Webdriver. I tried to log in to the system but after entering the password, system either directs to “Verification needed” page and says “We will email you a code to verify your identity. This is required when something about your sign-in activity changes, like signing in from a new device or location.”
or directs to “wrong password or email” page (eventhough I try correct account information).
So my question is: How can I handle that two factor authentication in my test script?
Note: I am using ChromeDriver and Java
there are two possible approaches:
first one, you can as Kiril S mentioned, get the link from email (mailinator.com is fine inbox for such testing).
second approach is avoiding the second verification with existing browser profile. Selenium uses a temporary profile, that's probably the reason of the second verification. I'm using existing browser profile (firefox), see Selenium Chromedriver - Open Chrome Normally. For Chrome should be similar.
I am unable to login using chrome browser but it works perfectly in Firefox. I guess yii session is not working in chrome? may be?
Sessions are independent from browser - they are stored on server. Browser has access only to session id which he gets from server trough cookie or as link parameter