views:

101

answers:

4

I have a web login page with the standard username password and login button controls. I would like to write a wrapper page that will render and auto fill the username and login form text boxes with a constant and force the onclick event for login button. Any suggestions how to accomplish this?

A: 

This sounds like a terrible idea, security-wise. Don't do it.

Galwegian
Does not answer the question or propose an alternative solution.
cfeduke
I agree from a security point, but for testing, using WaitN or IEUnit, as you said below, is GREAT.
Nic Wise
+1  A: 

If you want this sort of functionality to decrease overall testing time you should also take a look at:

WatiN

or

IEUnit

If you are doing this as a production feature of your system you should look at implementing some sort of "Remember Me" option with browser-based cookies - you would likely never want such a feature that automatically authenticates any anonymous person to a user to your system out in the wild.

cfeduke
+1  A: 

Depending on the specific form and how it is done, you can make a wrapper page that embeds the form inside an iFrame. You can then use JS to set the values inside the iFrame, and call the proper submit.

This would require testing and a bit of research, but i have seen it done.

NOTE: I also strongly caution against this due to the obvious security implications...but you know your situation/use better than we do.

Mitchel Sellers
A: 

If you're looking for a default login, as many sites show with a textboxes having "username" and "password", then they are attributes of the input tag.

If you want to automate a login for a demo purposes, as many FLOSS projects do, you could prefill with a combo of demo/demo (or similar), also as attributes of the input tag.

warren