I'm currently working on a website which takes 2-3 MINS to complete the page load. Even after all the elements are visible,still browser keeps loading. I have figured it out that happens because the website contains social media links such as Facebook, Twitter, LinkedIn, Instagram etc. Facebook access is prohibited in where I am right now. SO browser took so long to complete the connection between those buttons and social media servers. I blocked Facebook from host file even but no luck yet. Is there a way to stop running scripts or stop making connections with those servers from those buttons.?

PS: I'm not the developer of the website. So cannot change anything on the code. I checked with chrome,Firefox and even with IE drivers. - no luck.

  • Can you modify the browser with add-ons?
    – mutt
    Commented Oct 4, 2017 at 11:15
  • How did you block the connection using hosts? Try to block using firewall. P.S. - Open browser tools and make check if there are really handing requests in network monitor to faceboot so that you're sure the problem is in facebook requests.
    – Alexey R.
    Commented Oct 4, 2017 at 12:16
  • @mutt yes I can. is there a way then? Commented Oct 6, 2017 at 5:19
  • @AlexeyR. Yes I checked it. I'm working in a local company network and thats why facebook is blocked here. But Im sorry I dont know how to what u asked.. Commented Oct 6, 2017 at 5:27
  • This is a management problem not a QA or technical issue, the company policies are in conflict with your assigned work task. You cannot properly test the site if half of its functionality is missing. Escalate this to management. Commented Oct 17, 2017 at 14:38

3 Answers 3


If all hope is lost, and those sites are actually blocked internally, and this is worth the effort than you can redirect the calls to a local faked site. The easiest might probably be adding a static DNS Record for site X, and keeping a copy of the requested page on a local server.

  • Thanks for your concern @Rsf. could please explain further more like how to do that..? Commented Oct 6, 2017 at 5:18

On your browsers that run the tests install add-ons to block popups and external scripts. No-Script is a great on for Firefox, but each has their own. You will then need to go configure a white-list of what should be allowed and leave everything else blocked.

This will allow your site and test to run without any interference from third party site adds/scripts/etc... Just be sure you manually run through it and make sure it's set properly to prevent what you don't want and allow what you do want. Then the automation test would be able to run without interruption.


Thanks all for your concern on my problem. Finally I blocked facebook with host file in windows. I followed this Git repo. Now its running smoothly.

PS: If u follow the same method then you will realize that you can no longer access facebook through your machine. Since this solved my matter I quit from looking for further solutions but If anybody else knows a way to block facebook connectivity through selenium please comment below.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.