I am trying to login to a website and navigating to my dashboard page which essentially requires login element followed by the page to be opened. The Page i was trying to open will be active only after login to the first page.
My Code -
var page = require('webpage').create();
phantom.cookiesEnabled = true;
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open("https://login-page", function(status) {
if (status === "success") {
page.evaluate(function() {
console.log('Step 1 - Login JIRA');
document.getElementById("login-form-username").value = "user";
document.getElementById("login-form-password").value = "password";
document.getElementById("login-form-submit").click();
});
window.setTimeout(function() {
console.log('Step 2 - Save login page');
page.render("page.png");
page.open("https://page-after-login-to-take-screenshot", function(status) {
window.setTimeout(function() {
console.log('Step 3 - Save current page');
page.render("profil.png");
phantom.exit();
}, 5000);
});
}, 5000);
}
});
After running my code i am not able to see any output and also i didnt get any screenshots saved
C:\user\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin> .\phantomjs.exe I:\my_code\try2.js
***Nothing Happened****
After giving the console output to check what happening in the each step i got the below output -
DEPRECATED JS - Cookie has been deprecated since 5.8.0 and will be removed in a future release. Use cookie instead.
No stack trace of the deprecated usage is available in your current browser.
Project create didn't get a user META tag, or it had no content. Bailing out
DEPRECATED JS - Dropdown constructor has been deprecated and will be removed in a future release. Use Dropdown2 instead.
No stack trace of the deprecated usage is available in your current browser.
Downloading resources:
Step 1 - Login JIRA
DEPRECATED JS - Cookie has been deprecated since 5.8.0 and will be removed in a future release. Use cookie instead.
No stack trace of the deprecated usage is available in your current browser.
Downloading resources:
DEPRECATED JS - Dropdown constructor has been deprecated and will be removed in a future release. Use Dropdown2 instead.
No stack trace of the deprecated usage is available in your current browser.
AG.LayoutManager.setLayout: Can't manipulate layout. Layout is not writable
Security tokens will be refreshed every 720000ms
DEPRECATED JS - Inline dialog constructor has been deprecated and will be removed in a future release. Use inline dialog 2 instead.
No stack trace of the deprecated usage is available in your current browser.
Downloading resources:
js!/s/d41d8cd98f00b204e9800998ecf8427e-T/bjk90u/72010/b6b48b2829824b869586ac216d119363/7aa44fa9aad9a6239c392b1e7bc884f4/_/download/contextbatch/js/browser-metrics-plugin.co
ntrib,-_super,-atl.dashboard,-atl.general/batch.js?agile_global_admin_condition=true&atlassian.aui.raphael.disabled=true&is-server-instance=true&jag=true&jaguser=true&jcap=
true&nps-not-opted-out=true&sd_operational=true!order
Downloading resources:
css!/s/10d963e1fcee333a7f9aebf08e9b202d-T/bjk90u/72010/b6b48b2829824b869586ac216d119363/329db972cd13259548cc14eada2ef26b/_/download/contextbatch/css/com.atlassian.jira.plug
ins.jira-development-integration-plugin:devstatus-dialog-resources-ctx,-_super,-atl.general,-atl.dashboard/batch.css?agile_global_admin_condition=true&atlassian.aui.raphael
.disabled=true&is-server-instance=true&jag=true&jaguser=true&jcap=true&nps-not-opted-out=true&sd_operational=true
js!/s/a0d3356f3721fb8694c9496f54f4b3ce-T/bjk90u/72010/b6b48b2829824b869586ac216d119363/329db972cd13259548cc14eada2ef26b/_/download/contextbatch/js/com.atlassian.jira.plugin
s.jira-development-integration-plugin:devstatus-dialog-resources-ctx,-_super,-atl.general,-atl.dashboard/batch.js?agile_global_admin_condition=true&atlassian.aui.raphael.di
sabled=true&is-server-instance=true&jag=true&jaguser=true&jcap=true&locale=en-US&nps-not-opted-out=true&sd_operational=true!order
forceLayoutRefresh() is deprecated. Use resize() instead.
forceLayoutRefresh() is deprecated. Use resize() instead.
forceLayoutRefresh() is deprecated. Use resize() instead.
forceLayoutRefresh() is deprecated. Use resize() instead.
Step 2 - Save login page
Stopped here/Didnt go further
What i need to change in the code ?