IE Automation: how to click on a div

I am new to vb.net and I am trying to automate user login to a remote application on a website using vb.net. My login works, but I can't figure out how to click on the div to start the application. Relevant code:

ie = CreateObject("internetExplorer.Application")
ie.visible = True
ie.Navigate("https://thesite/default.aspx")

Do
    If ie.ReadyState = 4 Then
        Exit Do
    End If
Loop

      

This all works, but now I need to click on the div:

<div tabindex="0" title="myApp" class="tswa_boss" onmouseover="tswa_bossOver(this)" onmouseout="tswa_bossOut(this)" onmouseup="goRDP(this, huge block of encrypted stuff");" onkeypress="onmouseup()">

      

Since I cannot grab this element by id, I have the following code to select it.

For Each item As Object In ie.document.getelementsbytagname("div")
    If item.getAttribute("title").Equals("myApp") Then
        item.click()
    End If
Next

      

The code runs fine, but it doesn't fire the onmouseup () event with item.click (). Does anyone know how I can initiate this?

+3


source to share


1 answer


Adding item.onclick = item.onmouseup

up item.click()

as suggested by Teemu worked great.



0


source