I'm getting "The "path" argument must be of type string. Received type object" when trying to run a single test case using night watch.
I have 2 test files namely mywrkouthomepage.js and mywrkoutlogin.js under tests directory.
I am planning to run mywrkoutlogin.js using the command
node nightwatch --test tests\mywrkoutlogin
and it throws me with an exception "The "path" argument must be of type string. Received type object"
Issue-2: Trying to click on Login Button but it says element is not interactable
module.exports = {
before(browser) {
browser.maximizeWindow();
},
'MyWrkOuts Login Test#1' : function (browser) {
browser
.url('https://www.mywrkouts.com/')
.waitForElementVisible('body', 2000)
.useXpath().click("//*[contains(text(),'Login')]")
.pause(5000);
},
after(browser, done) {
browser.end(() => {
console.info('*--*--*--*--*--*--*--*--*--*--*--*--*');
console.info('*-- Clossing session... Good bye! --*');
console.info('*--*--*--*--*--*--*--*--*--*--*--*--*');
done();
});
}
};
Here is the error message: tests/mywrkoutslogin.js Results for: MyWrkOuts Login Test#1
tests/mywrkoutslogin.js ✔ Element <body> was visible after 33 milliseconds.
tests/mywrkoutslogin.js Error while running .clickElement() protocol action: element not interactable
tests/mywrkoutslogin.js
tests/mywrkoutslogin.js An error occurred while running .click() command on <//*[contains(text(),'Login')]>: element not interactable
tests/mywrkoutslogin.js at processTicksAndRejections (internal/process/next_tick.js:81:5)
tests/mywrkoutslogin.js ✖ [Mywrkoutslogin] MyWrkOuts Login Test#1 (6.871s)
tests/mywrkoutslogin.js *--*--*--*--*--*--*--*--*--*--*--*--*
tests/mywrkoutslogin.js *-- Clossing session... Good bye! --*
tests/mywrkoutslogin.js *--*--*--*--*--*--*--*--*--*--*--*--*
Issue-3: How to use ImplicitWait for each and every statement in Issue-2 rather than using pause command?
Thanks in advance,
Krishna
--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/16b6fd88-32a5-4f19-af95-1e6227410f67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Good morning Krishna,To answer your questions:Issue #1 - could we see the error output for the single test run like you provided for Issue 2.Issue #2 - someone already mentioned using a better selector, //button[contains(text(),"Login")] that should help narrow down your test failure.Issue #3 - you'll want to use a custom command like below.exports.command = function(selector, callback) {const { waitForConditionTimeout } = this.globals;this.waitForElementVisible(selector, waitForConditionTimeout, function() {// The nulls below are required or the runner throws exceptionsthis.moveToElement(selector, null, null).click(selector);});if (typeof callback === 'function') {callback.call(this);}return this;};
Regards,
--curtis
To unsubscribe from this group and stop receiving emails from it, send an email to nightw...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/781bc0e4-3516-4307-b5b5-2cce691ddd5e%40googlegroups.com.