Welcome Guest Search | Active Topics | Sign In | Register

AutoFill angularJS web page Options
Tom Wynne
Posted: Tuesday, July 11, 2017 8:53:53 PM
Rank: Member
Groups: Member

Joined: 1/29/2015
Posts: 26
I am running into an issue with web sites that our product needs to autofill using the WebBrowser control.
Some are starting to use AngularJS and I am trying to automatically fill in the values such as User Name and Password.
This is a site we are trying to interact with:

https://dashboard.dnb.com/login

Run the EvalScript code:
document.getElementsByName("email")[0].value = "test@test.com"
document.getElementsByName("password")[0].value = "password"

But pressing the button still says to please enter the values.

I am not familiar with AngularJS and have dug through many examples but still am stuck on how to get it to 'trigger' the input of the fields to their framework.




eo_support
Posted: Wednesday, July 12, 2017 7:50:11 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Hi,

The easiest way to do auto fill is to use LoadRequest to load a HTTP POST request, which is what occurs after user presses the login button. Here is a more detailed step by step of what happens:

1. The browser loads the login page;
2. The user fills in the user name and password box;
3. The user clicks "login" button;
4. The browser assembles a HTTP POST request, form data (that contains user name and password) are attached to this request;
5. The browser send this request to the server;

Instead of start simulating from step 2, you can start simulating from step 4. This would bypass all the JavaScript code.

It is possible that the web page intentionally includes some additional data beside user name and password in step 4 for security purpose. For example, they can include a security token that the server generated at step 1. Obviously in such cases you won't be able to skip step 1. In that case you will have to dig into the script code to find out what will make the server happy. You can use a traffic monitor such fiddler to compare the final login request sent when you use auto fill against the request sent when user clicks the button manually and then start from there.

Thanks!



You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.