Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception is thrown when trying to first navigate to a page decorated with the SetCookie attribute #160

Open
icnocop opened this issue Jan 11, 2018 · 1 comment

Comments

@icnocop
Copy link
Contributor

icnocop commented Jan 11, 2018

Hi.

An exception is thrown when trying to first navigate to a page decorated with the SetCookie attribute.

.\SpecBind.Selenium.IntegrationTests\Features\SetCookieTests.feature

Feature: Set Cookie

Scenario: Before first navigation
	Given I navigated to the Cookie page
	Then I am on the Cookie page

.\SpecBind.Selenium.IntegrationTests\Pages\CookiePage.cs

namespace SpecBind.Selenium.IntegrationTests.Pages
{
    using SpecBind.Pages;

    [PageNavigation("/")]
    [SetCookie("MyCookie", "some value", Expires = "3600")]
    public class CookiePage
    {
    }
}

Exception:

System.InvalidOperationException: unable to set cookie
  (Session info: headless chrome=63.0.3239.132)
  (Driver info: chromedriver=2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 10.0.15063 x86_64) (NoSuchCollection)

Stack Trace:

at SpecBind.ActionPipeline.ActionResultExtensions.CheckActionResult(ActionResult result) in C:\github\dpiessens\specbind\src\SpecBind\ActionPipeline\ActionResultExtensions.cs:line 46
   at SpecBind.ActionPipeline.ActionResultExtensions.CheckResult[T](ActionResult result) in C:\github\dpiessens\specbind\src\SpecBind\ActionPipeline\ActionResultExtensions.cs:line 20
   at SpecBind.PageNavigationSteps.GivenNavigateToPageWithArgumentsStep(String pageName, Table pageArguments) in C:\github\dpiessens\specbind\src\SpecBind\PageNavigationSteps.cs:line 125
   at SpecBind.PageNavigationSteps.GivenNavigateToPageStep(String pageName) in C:\github\dpiessens\specbind\src\SpecBind\PageNavigationSteps.cs:line 99
   at lambda_method(Closure , IContextManager , String )
   at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()
   at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors()
   at SpecBind.Selenium.IntegrationTests.Features.SetCookieFeature.ScenarioCleanup()
   at SpecBind.Selenium.IntegrationTests.Features.SetCookieFeature.BeforeFirstNavigation() in C:\github\dpiessens\specbind\src\SpecBind.Selenium.IntegrationTests\Features\SetCookieTests.feature:line 5

If the page decorated with the SetCookie attribute is not navigated to first, then the exception is not thrown.

For example

Scenario: Before first navigation
	Given I navigated to the Home page
	When I navigate to the Cookie page
	Then I am on the Cookie page
@icnocop
Copy link
Contributor Author

icnocop commented Apr 20, 2019

See SeleniumHQ/selenium#6775

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant