tags:

views:

250

answers:

3

My HTMLUnit tests are failing, and I've got a feeling it's because I'm entering a password using the setValueAttribute() method and that for some reason doesn't work. Any ideas? Am I supposed to pass HTMLUnit the encrypted form of the password?

EDIT:

The code to set the pass:

loginForm.getInputByName("loginPassword").setValueAttribute("1234");

A: 

The password field is not encrypted. It is just not rendered as plain text in the browser (dots or stars instead). You can make it visible with a tool, such as Webdeveloper toolbar for Firefox. So this should not be the problem. I am using HtmlUnit myself and it works.

ReneS
I've put some code up. Does that look normal?
Mike
+1  A: 

Hi,

This should work, can you please submit a test case to HtmlUnit user-list, so we investigate further?

Yours, Ahmed Ashour http://asashour.blogspot.com/

Please post the url to the defect here, so we can link it together.
ReneS
A: 

It does work, I have it working.

I would check to make sure you getting the correct input field name. If not, can you post the stacktrace.

The below code works for me. form.getInputByName("password").setValueAttribute("1234");

Ben