stirno / FluentAutomation

Simple Fluent API for UI Automation
http://fluent.stirno.com
MIT License
234 stars 98 forks source link

Unable to delete cookie exception inside Open on IE #137

Open pyusim opened 9 years ago

pyusim commented 9 years ago

Hi,

On IE (I am using IE11), my call to Open() always throws the same exception:

FluentAutomation.Exceptions.FluentException : An unexpected exception was thrown inside WaitUntil(Action). See InnerException for details. ----> System.InvalidOperationException : Unable to delete cookie with name 'OGPC' (UnexpectedJavaScriptError)

The name of the cookie changes depending on the URL, but I can never get through the call to Open() when using IE. On Chrome the test completes just fine.

When I try to open the URL using Selenium directly (see the two commented-out lines below), it always opens, which I take to mean that this is not a Selenium issue.

Please advise.

Thank you!

namespace AppTests.Fluent { [TestFixture] public class SampleTests : FluentTest { public SampleTests() { SeleniumWebDriver.Bootstrap( SeleniumWebDriver.Browser.InternetExplorer );

        //IWebDriver driver = new InternetExplorerDriver(@"C:\Users\pyusim\AppData\Local\Temp");
        //driver.Navigate().GoToUrl("http://www.google.com");
    }

    [SetUp]
    public void Setup()
    {
        FluentSettings.Current.ScreenshotPath = "C:\\Users\\pyusim\\Desktop\\TestScreenshots";
    }

    [Test]
    public void LandingPageTest()
    {
        //var url = "http://localhost:14315";
        var url = "http://www.google.com";

        I.Open(url);
        I.Assert.Url(url);
    }
}

}

stirno commented 9 years ago

There are a few open issues with Selenium and Fluent on IE11. First step would be upgrade the IEDriver instance. By default FluentAutomation unpacks its own which is a bit dated (we hope to do a new release soon that'll fix that). If it finds one in the bin folder though, it will use that instead. So you can grab the latest IEDriver from http://selenium-release.storage.googleapis.com/index.html?path=2.44/ -- add the .exe to your test project and set it to 'Copy Always'.

I can't test this directly at the moment because my windows VMs are in a strange state but I'll see if I can get something worked out. Let me know if the newer IEDriver works for you, Thanks!