0

My company uses Multi-factor authentication to restrict access to some sites. Is it possible to copy user profile from firefox and use it in my new window?

  • What are you trying to achieve? By "some sites" you mean external sites or your product you want to check? If the former, what is the relevance for using Selenium? If the later, why not simply feature flag out the auth in test environments? – João Farias Jan 7 at 17:59
1

Yes you can achieve this using profile:

Just login to the system and save the login session,

you can get profile folder by typing chrome://version in tab:

enter image description here

  1. Open path\Google\chrome folder

  2. goto user data folder

  3. Copy the path to Default folder

Now set it in chromeoptions:

chromeOptions:{'args': ['--user-data-dir=%yourpath%\\Local\\Google\\Chrome\\User Data']}

Note : this code is for protractor , you can use the python equivalent

make sure that there is no space after '=' sign and now quotes eg don't use '--user-data-dir="%yourpath%\\Local\\Google\\Chrome\\User Data"'

Also make sure all chrome sections are closed

If you are copying th profile to another folder say testprofile, keep the folder name as default so you just need to use

chromeOptions:{'args': ['--user-data-dir=%yourpath%\\testprofile']}

if the profile folder is not as testprofile\Default the you have to pass it as

--profile-directory=<thenewfoldername>
| improve this answer | |

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.