javascript - Hide user input in PhantomJS / CasperJS -
i have casperjs test suite in have fill login form user name , password. since don't want put password code did this:
system.stdout.writeline("please enter password:"); var password = system.stdin.readline(); this.fill('form:first-of-type',{ 'username': user, 'password': password },true);
this works, leaves password on console can read it. there way hide actual input view, or display ******** in place?
or there perhaps approach problem have missed?
edit: tried using execfile
, doesn't when try run read
, returns nothing ever happened. other external programs work fine.
i found crude workaround:
system.stdout.write("please enter password:"); var password = system.stdin.readline(); system.stdout.write("\033[1aplease enter password: \n");
will move cursor 1 line , print on password. problem remains, hides password after has been entered. if watching type, won't much. @ least won't visible on console later on.
Comments
Post a Comment