Unable to Login using Casper engine and Login function is added in onBefore java script.
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Version: BackstopJS v3.5.14
I have added below mentioned login function to onBefore java script file, located in casper engine.
Login function is not working for our websites and please find the below mentioned code for your reference,
module.exports = function (casper, scenario, vp) {
console.log('onBefore.js has run for ' + vp.name + '.');
casper.options.waitTimeout = 40000;
casper.start(scenario.url, function() {
casper.waitUntilVisible('dnn_ctr_Login_pnlLogin', function (){
console.log('.....Trying to login......');
this.fillSelectors('dnnFormItem', {
'input[id = dnn_ctr_Login_Login_DNN_txtUsername]' : 'uatuser',
'input[id = dnn_ctr_Login_Login_DNN_txtPassword]' : 'Valeant$1'
});
this.click('dnn_ctr_Login_Login_DNN_cmdLogin');
});
casper.waitUntilVisible('#ius-user-id-manager-content-label', function() {
console.log('.....logged in......');
console.log('current url....' + this.getCurrentUrl());
});
});
};
Once URL is launched, the site is redirecting into login page. The login function should work then only i can proceed with other pages for capturing the screenshot.
The site which i am working is built in DotNetNuke - 9.2 platform.
Kindly provide the solution for Login feature.
Contributor guide
Assessment
This issue has not been assessed yet.