I don't have the rep to comment on this question, so I'll have to add my own.

I want to automate testing of the SF Oauth server auth flow. I can go through it manually, and everything works, but when I run my test (Selenium, chromedriver, using the same credentials, I get an email with the title "Verify your identity in Salesforce", which contains (redacted) this:

You recently logged in to Salesforce from a device we don't recognize.

Browser: Chrome Operating System: Linux Username: [email]

To ensure your account's security, we need to verify your identity. Enter the following code where prompted by Salesforce.

Verification Code: [code]

I take screenshots throughout the process. My screenshot for after I click on the Salesforce oauth window's "Login" button does not show anything, other than the form.

I don't think this is due to Multi-factor auth, which is not set on my account. I think it's happening because Salesforce does some "bot check", recognizes my test is not a 'real user', and triggers the email. My screenshots don't show any alert or new window, so even if I went to the trouble of getting the email programatically, I wouldn't know how to use the verification code.



Salesforce shows that screen on the basis of your ip. so if you want to bypass that screen create a new profile specific only for selenium test and Add ip range on that specific profile from to and run your selenium test.

enter image description here

enter image description here

| improve this answer | |
  • How do I get to that screen? – James Bowler May 9 '16 at 15:34
  • You can enble advanced profle from setup->customozes->user interface – Himanshu May 9 '16 at 19:05

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.