This is the last I've tried, but the problem is that once the popup is on the screen, I can't use the Console to get any of the selectors, I only see the html and body tags. PLEASE HELP!
module.exports = { 'Demo test Google' : function (client) { client .url('https://practice.expandtesting.com/#examples') client.pause(1000) client.click('#examples > div:nth-child(4) > div:nth-child(3) > div > div > h3 > a') client.pause(2000) client.setValue('Username', 'testuser') client.keys.TAB client.setValue('Password', 'testpass') client.end(); } }
Seleniumcan't interact with a native JS Alert popup (browser popup you mentioned). Consequently, it is necessary to switch to the JS Alert and utilize the appropriate methods.Fortunately,
Nightwatchmethods seamlessly handle the switch to JS Alerts, leaving us only to employ the following methods:In your case you will need to use
setAlertText()and then accept the JS Alert after you're done usingacceptAlert();Source: https://nightwatchjs.org/v26/api/setAlertText.html