Simulate Actions Using a Headless Browser

Tell us what’s happening:

ANY help will be appreciated PLEASE
I’m reaaly stuck on this Headless Browser Project.

Added every necessary code, but not working.

I can’t believe I’m still on this one challenge since last year December. I’m really exhausted!

Your code so far

The link to my code please:

Thanks for helping

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Challenge Information:

Quality Assurance and Testing with Chai - Simulate Actions Using a Headless Browser

hello, are you sure you are putting in correct url for Browser.site?

happy coding :slight_smile:

You have added functional tests to the unit tests. Remove the code on line 81 and below inside 1_unit-tests.js

As said, you can see when you run the tests, you get a 503 from the URL you are using. Instead, use the URL you get when you open the page using the “New tab” button (top right by the preview window).

Done all you suggested. Not still working

Thanks though. I guess I will leave it, will learn it on another platform. Thanks

If I fork your Replit and update the Browser.site value to be my own URL, it passes the tests. It should also pass with http://localhost:3000 for the value.

In the lines:
suiteSetup(function (done) {
return browser.visit(“/”, done);
});
The second “done” should have a parenthesis to close it. Like done()

No it shouldn’t.

It is a callback function, you do not invoke callbacks, you just pass the definition to whatever is meant to call the function. Just like an event handler, you pass the definition to the listener, and it calls the handler when the event is triggered.

You should use the syntax as shown on the challenge page and in the docs.


If you call the done function, you are passing its return value as the argument to visit (which isn’t correct).

If you pass the function definition, it can be call when needed. In the case of the visit function, the callback function looks to be passed around multiple times before it is invoked.

source

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.