How to disable Javascript when using Selenium?

前端 未结 16 715
星月不相逢
星月不相逢 2020-12-05 05:07

I am wondering how do I disable javascript when using selenium so I can test server side validation.

I found this article but I don\'t know what to really do. Like I

16条回答
  •  鱼传尺愫
    2020-12-05 05:50

    Set the browser name in the selenium settings to htmlunit.

    This is a driver that has JavaScript disabled by default https://code.google.com/p/selenium/wiki/HtmlUnitDriver . The JavaScript required for selenium to interact with the page will still be able to run.

提交回复
热议问题