Reputation: 76
I am trying to click an element in Nightwatch:
client
.waitForElementVisible('.tt-suggestions div:nth-child(4)', 2000)
.click('.tt-suggestions div:nth-child(4)', function(clickStatus) {
console.log(clickStatus);
});
I check the clickStatus, and it returns 'success' so the click is being fired on the element. However, it does not reflect in the UI. Any suggestions?
Upvotes: 1
Views: 527
Reputation: 1658
I have found that sometimes you need to add a pause in order for the click to be performed in the browser. Therefore try this in your test:
client
.waitForElementVisible('.tt-suggestions div:nth-child(4)', 2000)
.pause(1000)
.click('.tt-suggestions div:nth-child(4)', function(clickStatus) {
console.log(clickStatus);
});
Upvotes: 1