Skip to content

PageTests don't seem to work #27

@VoidMonk

Description

@VoidMonk

Hi, I copied the two tests from PageTests.cs to a standalone executable for testing purposes, but query selector returns no results for some strange reason.

async static void RunScriptSelectorTest()
{
    var url = "http://html5test.com"; // same URL as in the test
    var sel = "#score > .pointsPanel > h2 > strong"; // same valid selector path as in the test
    var config = Configuration.Default
                .WithCss()
                .WithJavaScript()
                .WithDefaultLoader(setup => setup.IsResourceLoadingEnabled = true);
    var document = await BrowsingContext.New(config).OpenAsync(url);
    var elements = document.QuerySelectorAll(sel);
    // but no results (elements.Length is zero),
    // even though given selector has one match
}

Any ideas on what might be going wrong, as compared to the passing tests?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions