1

Can someone please help me, how to set the capability 'applicationCacheEnabled' to 'false'? I have tried below, but seeing syntax errors.

DesiredCapabilities dc=DesiredCapabilities.firefox();
dc.setCapability("applicationCacheEnabled", "false");
WebDriver driver= new FirefoxDriver(dc);

Selenium version: 2.35.0, Java version: 1.7.0_07

Srikanth Nakka
  • 758
  • 4
  • 16
  • 35

1 Answers1

2

The syntax in the question is absolutely correct. The syntax error was due to calling the 'setCapability' method at the class level[directly under a class, outside a block] rather than within a block. I have moved the method invocation to some method.

Just adding one more point:

dc.setCapability("applicationCacheEnabled", "false"); can also be written as, 
dc.setCapability(CapabilityType.SUPPORTS_APPLICATION_CACHE, false);
Srikanth Nakka
  • 758
  • 4
  • 16
  • 35