[HTMLUnit] Virtual Keyboard
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: [HTMLUnit] Virtual Keyboard

  1. #1
    Join Date
    Nov 2011
    Posts
    1

    [HTMLUnit] Virtual Keyboard

    Hey !

    I want to create a Java program that can retrieve data from websites.

    I succefully send HTML Forms (like this : )

    Code:
    public static void submittingForm() throws Exception {
    		final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3_6);
    
    		webClient.setThrowExceptionOnScriptError(false);
    
    		final HtmlPage page1 = webClient
    				.getPage("http://bokobok.free.fr/index.php?page=post&action=newuser");
    
    		final List<HtmlForm> forms = page1.getForms();
    
    		HtmlForm form = null;
    
    		while (!forms.isEmpty()) {
    			form = forms.remove(0);
    			if (form.getId() == "form")
    				break;
    		}
    
    		if (form != null) {
    			HtmlButton submitButton = (HtmlButton) page1
    					.createElement("button");
    			submitButton.setAttribute("type", "submit");
    			form.appendChild(submitButton);
    			final HtmlTextInput lastName = form.getElementById("nom");
    			final HtmlTextInput firstName = form.getElementById("prenom");
    			final HtmlTextInput mail = form.getElementById("mail");
    			final HtmlPasswordInput pass = (HtmlPasswordInput) form
    					.getElementById("pass");
    			final HtmlPasswordInput pass2 = (HtmlPasswordInput) form
    					.getElementById("pass2");
    
    			lastName.setValueAttribute("TestLastName");
    			firstName.setValueAttribute("TesFirstName");
    			mail.setValueAttribute("mail@mail.com");
    			pass.setValueAttribute("root");
    			pass2.setValueAttribute("root");
    			submitButton.click();
    		}
    
    		webClient.closeAllWindows();
    	}
    What I wanna do now is to log into a website that use virtual keyboard input like this :

    https://www.boursorama.com/connexion.phtml?

    Enter "00000000" into "Identifiant"

    Then click into "Mot de passe"

    Now you see this :

    http://www.codeguru.com/forum/attach...1&d=1321968164

    What can I do to enter the code "123456789" for example ?

    Thanks!
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center