0

I am testing Salesforce Lightning pages on Chrome using Selenium Webdriver code that's in a C# NUnit project in Visual Studio 2019. I get the Login page every time I run a test. enter image description here

I used to get the Verification page after the login page but after I added the IP address of the Chrome browser to the list of trusted addresses as recommended here, How to Automate the salesforce login OTP feature using selenium WebDriver? the verification page is not coming up anymore.

When I test Salesforce using UFT or Selenium IDE, the login page never comes up.

As can be seen in the attached image, I even have the "Remember Me" checkbox checked.

How can I stop the login page from coming up when I am testing Salesforce Lightning using Selenium Webdriver?

Also, how can Selenium recognize Javascript popups on the page like the Allow Notifications popup in the image below?

enter image description here

Burak
  • 300
  • 2
  • 14
  • 1
    Hi Burak. You can bypass this issue by having the proper cookies into your opening bot browser. What I mean is that you can export your profile from a browser and include it inside the configuration of your selenium-webdriver. Thus, every time you open the platform having the cookies will not ask you again to follow the login process. Check also here from the official website of Selenium: https://www.selenium.dev/documentation/en/driver_idiosyncrasies/driver_specific_capabilities/ – dpapadopoulos May 04 '20 at 16:59
  • I do not see anything regarding Chrome on that page. Do you know how Selenium can recognize Javascript popups like the one I included at the end of my question? – Burak May 04 '20 at 17:23
  • 1
    Sorry, for not mentioning. Of course, you can for Chrome too. You can insert a profile instance as an option in the ChromeDriver object. I don't think that selenium can click on that because it's not web element but pop-up from an app. Here is the link that I was talking about: https://sites.google.com/a/chromium.org/chromedriver/capabilities AND also one more: https://stackoverflow.com/questions/33218794/enabling-popup-windows-in-chrome-by-selenium – dpapadopoulos May 04 '20 at 17:32
  • So, how can Selenium get rid of that Notifications pop-up? – Burak May 04 '20 at 17:55
  • 1
    There is really vital and detailed answer in StackOverflow already, here: https://stackoverflow.com/questions/38684175/how-to-click-allow-on-show-notifications-popup-using-selenium-webdriver – dpapadopoulos May 04 '20 at 17:58
  • 1
    A random upvote in one of m my answers would be appreciated hahaha. Kidding. Keep automating :) – dpapadopoulos May 04 '20 at 18:28

0 Answers0