1

I tried to Automate the Facebook page In selenium using credentials it works. (It automatically login into Facebook.) But I am not able to do the same thing with the Registration page on Facebook. It has some kind of pop up page to register (https://www.facebook.com/), If someone is able to do it please let me know. [registration page 1

1 Answers1

1

This is worst practice in selenium automation For multiple reasons, logging into sites like Gmail and Facebook using WebDriver is not recommended. Aside from being against the usage terms for these sites (where you risk having the account shut down), it is slow and unreliable.

The ideal practice is to use the APIs that email providers offer, or in the case of Facebook the developer tools service which exposes an API for creating test accounts, friends, and so forth. Although using an API might seem like a bit of extra hard work, you will be paid back in speed, reliability, and stability. The API is also unlikely to change, whereas webpages and HTML locators change often and require you to update your test framework.

Logging in to third-party sites using WebDriver at any point of your test increases the risk of your test failing because it makes your test longer. A general rule of thumb is that longer tests are more fragile and unreliable.

WebDriver implementations that are W3C conformant also annotate the navigator object with a WebDriver property so that Denial of Service attacks can be mitigated.

Justin Lambert
  • 940
  • 1
  • 7
  • 13
  • if you want to automate login functionality you can use demo sites from here https://www.techbeamers.com/websites-to-practice-selenium-webdriver-online/ – Justin Lambert Aug 25 '20 at 06:24