Disable javascript chromedriver?

285 views
Skip to first unread message

SomeEpicNoob

unread,
Dec 4, 2013, 12:30:15 PM12/4/13
to webd...@googlegroups.com
https://code.google.com/p/selenium/issues/detail?id=3175

Tried that doesn't work. 

So then I tried this,
ChromeOptions opts = new ChromeOptions();
opts.addArguments("--disable-javascript");
driver = new ChromeDriver(opts);
						
But then driver.get(website); 
javascript is enabled again. When it was on data; it was disabled. 

Also I tried,
DesiredCaptabilities caps = DesiredCaptabilties.chrome();
caps.setJAvaScriptEnabled(fale);
driver = new ChromeDriver(caps);
driver.get(Website);

Nothing is working. Any advice?

Andreas Tolfsen

unread,
Dec 6, 2013, 7:57:35 AM12/6/13
to webd...@googlegroups.com

I'm not an expert on chromedriver's internals but I suspect it's not
possible to switch it off because WebDriver extensively relies on
JavaScript being enabled.

For example, all the WebDriver atoms, are written in JS and needs a
working interpreter in the document:

http://code.google.com/p/selenium/wiki/AutomationAtoms
Reply all
Reply to author
Forward
0 new messages