Export to GitHub

phantomjs - issue #1149

Want to put values in some text boxes through phantomjs


Posted on Apr 10, 2014 by Grumpy Camel

i just wanted to know 1.How to put my emial id and password in gmail's text box through phantomjs and i would be running that js file through command prompt. 2.How to click on some hyperlink or any button through phantomjs.

Please help!!!!!

i am using below mentioned code, and error attached in attachment

console.log('Loading a web page'); var page = require('webpage').create(); var url = 'http://www.gmail.com/'; page.open(url, function (status) { console.log("Status: " + status); page.render('1.jpg');

page.evaluate(function(){

    var arr = document.getElementsByName("gaia_loginform");
    arr[0].elements["username"].value="rajniranjanjha9";
    arr[0].elements["password"].value="ilovepapa";
arr[0].elements["submit"].click();

console.log("Status: " + status); page.render('2.jpg'); return;

phantom.exit(); }); });

Attachments

Status: New

Labels:
Type-Defect Priority-Medium