Welcome Guest Search | Active Topics | Sign In | Register

How to fill a web form with username and password using eo.webbrowser for .net Options
Stamos
Posted: Wednesday, March 12, 2014 12:34:41 PM
Rank: Newbie
Groups: Member

Joined: 3/12/2014
Posts: 1
Hello,
I have just downloaded the trial version of eo.webbrowser for .Net . I would like to know the way to fill various form fields in a web page.
As an example I want to fill username and password to the following page: e-services.minagric.gr and then hit the submit button.

Thank you
Stamos
eo_support
Posted: Wednesday, March 12, 2014 1:09:05 PM
Rank: Administration
Groups: Administration

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

You would use EvalScript for that. For example:

Code: C#
//Set textbox "user_name"'s value to "test"
webView1.EvalScript("document.getElementByid('user_name').value = 'test';");


Note that the script would depends on your page. For example, the above code assumes that the ID of the user name textbox is "user_name". Since every page is different, so it is not possible for the WebView component to provide generic method for you to fill the form and submit. You would have to rely on JavaScript code to do so, which you can run from your code by calling EvalScript.

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.