1

I'm following This to get a website's dynamic content inside an MVC application.

I've received the data once or twice, but after that I'm getting an error -

ApplicationCache driver.ApplicationCache threw an exception of type 'System.InvalidOperationException' OpenQA.Selenium.Html5.IApplicationCache {System.InvalidOperationException} Message: Driver does not support manipulating the HTML5 application cache. Use the HasApplicationCache property to test for the driver capability

demouser123
  • 4,108
  • 9
  • 50
  • 82
Newbie
  • 39
  • 1
  • 9

1 Answers1

0

The error that you're encountering is due to the fact that PhantomJS can't find anything in the appCache and hence throws this exception. Please see the underlying code here, which states

public IApplicationCache ApplicationCache
    {
        get
        {
            if (this.appCache == null)
            {
                throw new InvalidOperationException("Driver does not support manipulating the HTML5 application cache. Use the HasApplicationCache property to test for the driver capability");
            }

            return this.appCache;
        }
    }

And the reason, why this is coming to be null is that currently PhantomJS doesn't supports this app caching. The default capabilities for this is set to false in the PhantomJS code . You can see this here, which mentions

 _defaultCapabilities{
      "applicationCacheEnabled" : false,
 }
demouser123
  • 4,108
  • 9
  • 50
  • 82