Jump to content
Sign in to follow this  
Arlen

"_IEGetObjByName" not working for me.

Recommended Posts

Hi, I am trying to make my router auto restart using IE.au3 but I am stuck, and I can't click the "Restart" Button. I have no idea what is wrong. 

 

;First try
Local $Reboot = _IEGetObjByName($oIE, "btnReboot")
_IEAction($Reboot, "click")

;Second try
Local $Reboot = _IEGetObjById($oIE, "btnReboot")
_IEAction($Reboot, "click")

;Third try
_IELinkClickByText($oIE, "Restart")

I have included an image aswell.

Reboot.PNG

Share this post


Link to post
Share on other sites

Most likely you have frames. You will need to point to the correct frame using _IEFrameGetCollection and then do _IEGetObjById.

You can also try to call the java function "Reboot()" directly. Search the forum for "Run Java" examples.

Share this post


Link to post
Share on other sites
12 hours ago, Juvigy said:

Most likely you have frames. You will need to point to the correct frame using _IEFrameGetCollection and then do _IEGetObjById.

You can also try to call the java function "Reboot()" directly. Search the forum for "Run Java" examples.

 

Do you have any example that can guide me? Been trying to do with "_IEFrameGetCollection" but no luck.

 

I tried this but did not work.

_IELoadWait($oIE)
$oFound = ""
$oBtns = _IETagNameGetCollection($oIE, "input")
For $oBtn In $oBtns
If String($oBtn.classname) = "submit" Then
    $oFound = $oBtn
EndIf
Next
If IsObj($oFound) Then
    _IEAction ($oFound, "click")
EndIf

 

Edited by Arlen

Share this post


Link to post
Share on other sites

You can check this example:

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IE_Example("frameset")
Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
Local $oFrame = 0
For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)
    $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF
Next
MsgBox($MB_SYSTEMMODAL, "Frames Info", $sTxt)

_IEQuit($oIE)

 

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...