Sorry to pester everyone with my lack of knowledge, but any help on this matter would be appreciated, thanks:
So, having looked around various forums and threads i found that mouse simulation and mouse clicking can be achieved through VB.NET; more specifically, i found this code:
Dim pointer As New Point(800, 575)
Dim ele As HtmlElement = Form1.WB1.Document.GetElementFromPoint(pointer)
ele.InvokeMember("click")
The coordinates in the Point(800, 575) function call correspond to the location of a button i would like to click. I know these are correct as i used some of my own code to find out the position of my cursor inside a VB.NET web browser, and have checked it with other tests.
But my problem is the code above does not work!
Here is my code:
Public class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
WB1.Show() ' WB1 is my Web Browser
WB1.GoHome()
Dim mouse As New Click
mouse.Move()
End Sub
' .....more code here relating to the web browser.....
End Class
Public Class Click ' This class is in a separate file
Public Sub Move()
Dim pointer As New Point(800, 575)
Dim element As HtmlElement = Form1.WB1.Document.GetElementFromPoint(pointer)
element.InvokeMember("click")
End Sub
End Class
There is no mouse movement inside the web browser, and no buttons are clicked; but there are no syntax erros in my code!
So to summarise, i would like to know how i can simulate mouse movement and mouseclicks on a page, and if there are errors with my code. As well as this, if anyone knows how to type into a form/text box once the cursor has been clicked in that would be brilliant - for example moving the cursor into the Google search box, then clicking in it, and then typing in a search string.
Thank you in advance.