lee greco
lee greco

Reputation: 11

Testcafe Authentication issues

I have a Fixture which includes 2 Tests. Both tests accessing the same site with httpAuth(). The first request loads the page correctly and everything is ok. But the second test can't even load the page completely. A lot of requests are stuck on "Pending". On the IIS and also on our Proxy i see that every Request from Testcafe-Hammerhead is logged twice first with an 401 without credentials and then 200 with credentials. But when checking the log for the Second test for some request i only see the 401 Request without credentials.

After some minutes the test stops because of timeouts.

Here is a sample of the Test:

fixture("Getting Started").page(pageUrl).httpAuth(devAuth);
test("Test 1", async t => {
    await t.maximizeWindow();
    await t.debug();
    var text =  Selector("#content").find("h1");
    var headerText = await text.innerText;
    console.log("Found text: " +headerText);
    
    await t.expect(headerText).eql("About our Team");
});
test("Test 2", async t => {
    await t.maximizeWindow();
    await t.debug();
    var text =  Selector("#content").find("h1");
    var headerText = await text.innerText;
    console.log("Found text: " +headerText);
    
    await t.expect(headerText).eql("About our Team");
});

Upvotes: 0

Views: 485

Answers (1)

lee greco
lee greco

Reputation: 11

We found out that Testcafe opens for every request a new connection on our Proxy. This used all available connections and no new connections could be made which results that some requests are stuck in "Pending". That every request opens a new Connection on our Proxy is only via Testcafe. We will further investigate this.

Upvotes: 1

Related Questions