0

I have created an application in selenium wherein it opens IE browser and enters user id and password by usind selenium's IE driver. However I want to prevent user from inspecting the auto data filled by selenium in the form. User can easily inspect the data using developer tools. So I want to know the way to disable developer tools options in selenium opened webpages.

Your help is highly appreciable.

Thanks.

Amol Dongare
  • 23
  • 1
  • 7
  • Facebook have done the same... [How does Facebook disable the browser's integrated Developer Tools?](http://stackoverflow.com/questions/21692646/how-does-facebook-disable-the-browsers-integrated-developer-tools) ...so marking this as a duplicate question. P.S It's a horrible idea. – Arran Jun 25 '14 at 14:25

1 Answers1

1

Instantiate an instance of OpenQA.Selenium.Interactions.Actions then perform keystrokes for the F12 control. This should toggle on/off the developer tools in Chrome, IE, and Firefox.

I would also include a check to see if one of the controls from the devtools is there before toggling this, just to be sure that you don't turn them on instead of off.

c#:

    OpenQA.Selenium.Interactions.Actions actions = new OpenQA.Selenium.Interactions.Actions([Instance of IWebDriver goes here]);
    actions.SendKeys(OpenQA.Selenium.Keys.F12).Perform();
mutt
  • 783
  • 1
  • 7
  • 11