You need to sign in to do that
Don't have an account?

SFDC asking for 2 step verification for each Selenium Run
Hi,
Currently I am working on some Automation testing on Salesforce using Selenium webdriver.Salesforce system asks for a two step verification code(mobile/email OTP) apart from the usual credentials.Now, once you verify the user with the OTP, the application supposedly saves it in the cookies. So, from next instances only user id-pwd combination is sufficient to logon.
So, for that I have created a custom profile in firefox and tried to launch it through my code.But each time I am running it, a new temp profile is getting created where the cookie details are not saved already.
This is the snippet of the code:
ProfilesIni allProfiles = new ProfilesIni();
FirefoxProfile profile = allProfiles.getProfile("SFDC");
WebDriver driver = new FirefoxDriver(profile);
When I am trying to log in manually this(2 step verification) is not happening.The automated execution was working properly before 27th Jan.
Can you please help?
Currently I am working on some Automation testing on Salesforce using Selenium webdriver.Salesforce system asks for a two step verification code(mobile/email OTP) apart from the usual credentials.Now, once you verify the user with the OTP, the application supposedly saves it in the cookies. So, from next instances only user id-pwd combination is sufficient to logon.
So, for that I have created a custom profile in firefox and tried to launch it through my code.But each time I am running it, a new temp profile is getting created where the cookie details are not saved already.
This is the snippet of the code:
ProfilesIni allProfiles = new ProfilesIni();
FirefoxProfile profile = allProfiles.getProfile("SFDC");
WebDriver driver = new FirefoxDriver(profile);
When I am trying to log in manually this(2 step verification) is not happening.The automated execution was working properly before 27th Jan.
Can you please help?
so the logic would be:
- open your cookie file
- If you find it - add it to your driver (driver.manage().addCookie(cookie);)
- If you don't find it - then get it from the driver and save it to the cookie file
There is a good article on this here: http://www.guru99.com/handling-cookies-selenium-webdriver.html