Sign in to follow this  
Followers 0
PresFox

Clicking Button via _IEattach

4 posts in this topic

#1 ·  Posted (edited)

Hello,

I am trying to click a "NEXT" button in a internet explorer server object.

The source is this:

2u5gebr.png

This is my code:

There are no errors, the $oBtn is valid and not empty, yet the button is not clicked.

What am i doing wrong?

If WinWait("[CLASS:WindowsForms10.Window.8.app.0.3d893c_r35_ad1]", "", 20000) Then
   ; Waiting for the window to get in front of desktop
   WinActivate("[CLASS:WindowsForms10.Window.8.app.0.3d893c_r35_ad1]");
   WinWaitActive("[CLASS:WindowsForms10.Window.8.app.0.3d893c_r35_ad1]")
Endif
   ; Attach the installer ie frame, (do a loop to make sure of that)
   While 1
      Local $oIE = _IEAttach("[CLASS:WindowsForms10.Window.8.app.0.3d893c_r35_ad1]","embedded")
      If @error = $_IEStatus_Success Then ExitLoop

   WEnd

While WinExists("[CLASS:WindowsForms10.Window.8.app.0.3d893c_r35_ad1]")
      Sleep(3000)
     Local $oBtn = _IEGetObjByName($oIE, "nombre")
     If @error = $_IEStatus_Success Then _IEAction($oBtn, "click")
wend
Edited by PresFox

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Windows is matching correctly?

It Works?-> (@error = $_IEStatus_Success)

I am not sure but also try _IEGetObjByName($oIE, "Bnext")

In Help File:

String to search for (for "embedded" or "dialogbox", use Title sub-string or HWND of window)

"embedded" = title sub-string or hwnd of of the window embedding the control

Edited by GordonFreeman

Share this post


Link to post
Share on other sites

Windows is matching correctly?

It Works?-> (@error = $_IEStatus_Success)

I am not sure but also try _IEGetObjByName($oIE, "Bnext")

In Help File:

String to search for (for "embedded" or "dialogbox", use Title sub-string or HWND of window)

"embedded" = title sub-string or hwnd of of the window embedding the control

I tried replacing it with:

If @error = $_IEStatus_Success Then MsgBox(0,"found","found")
         ;_IEAction($oBtn, "click")

Then the messagebox is shown, so the match is there, it just doesnt click it. Can it have something to do with the onclick?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

_IEAttach( WinGetHandle("[CLASS:WindowsForms10.Window.8.app.0.3d893c_r35_ad1]"),"embedded")

Also try it

With the page address would be easier = D

Edited by GordonFreeman

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0