Jump to content

Frame Notification Bar Not Exists Even "_IEAction($oElement, "click")" return 1


Recommended Posts

Hi, community. Don't know where to debug anymore.

Before this I received "Frame Notification Bar" listed when run

Local $sClassList = WinGetClassList("[CLASS:IEFrame]")
    _writeLog("list  CLASS: "&$sClassList )

But after a few time testing, the "Frame Notification Bar" does not listed anymore. Not sure why. Even though I have reverted the code to initial condition. I suspected because not closing IE properly. I have disable and enable back and restart the computer but not yet found back the class.

My code: 

if(StringInStr($oTd.innerText, $keyWord)<>0) Then
                    Local $oElements = _IETagNameAllGetCollection($oTd)
                    For $oElement In $oElements
                        if(StringInStr($oElement.innerText, $keyWord)<>0) Then
                            Local $status_click = _IEAction($oElement, "click")
                            If ($status_click = 1) Then
                                _writeLog("Action Success perform - click on selected link: "&$keyWord)
                            Else
                                _writeLog("failed perform Action Link")
                            EndIf
                            Return $status_click
                        EndIf
                    Next
                 EndIf

Any help needed.

Result:

Success to click Download
list  CLASS: BrowserFrameGripperClass
Client Caption
WorkerW
ReBarWindow32
TravelBand
ToolbarWindow32
Address Band Root
AddressDisplay Control
Edit
ToolbarWindow32
ToolbarWindow32
TabBandClass
DirectUIHWND
ControlBandClass
ToolbarWindow32
CommandBarClass
ReBarWindow32
Frame Tab
TabWindowClass
Shell DocObject View
Internet Explorer_Server

Version 3.5.4 

Edited by triple_N
add info
Link to post
Share on other sites

This URL is not accessible (oh surprise !).  I wanted to access the site to help you out.  I cannot solve your problem only at looking at an URL.

You will need to provide the DOM  of the object you are trying to click on.

Link to post
Share on other sites
8 minutes ago, Nine said:

This URL is not accessible (oh surprise !).  I wanted to access the site to help you out.  I cannot solve your problem only at looking at an URL.

You will need to provide the DOM  of the object you are trying to click on.

Oh sorry.

<table class="datatable">
        <tr>
            <th>Zone</th>
            <th>Subdomain</th>
            <th>Application Name</th>
            <th>File Name</th>
            <th>Backup Date</th>
            <th>Download</th>
        </tr>
        <tr>
            <td><span>ucs1</span></td>
            <td><span></span></td>
            <td><span>auc</span></td>
            <td style="text-align: left"><span>cluster01_aucdb_01_202007152308</span></td>
            <td><span>23:08, 15/Jul/2020</span></td>
            <td><a href="./files?4-1.ILinkListener-files-0-download">Download</a></td>
        </tr><tr>
            <td><span>ucs1</span></td>
            <td><span></span></td>
            <td><span>ucs01</span></td>
            <td style="text-align: left"><span>cluster01_ucsdb_01_202007152308</span></td>
            <td><span>23:08, 15/Jul/2020</span></td>
            <td><a href="./files?4-1.ILinkListener-files-1-download">Download</a></td>
        </tr><tr>
            <td><span>zone1</span></td>
            <td><span></span></td>
            <td><span>zc01</span></td>
            <td style="text-align: left"><span>zone01_zcdb_01_202007151508</span></td>
            <td><span>15:08, 15/Jul/2020</span></td>
            <td><a href="./files?4-1.ILinkListener-files-2-download">Download</a></td>
        </tr><tr>
            <td><span>zone1</span></td>
            <td><span></span></td>
            <td><span>master_uis</span></td>
            <td style="text-align: left"><span>zone01_muisdb_01_202007160300.tar.gz</span></td>
            <td><span>03:00, 16/Jul/2020</span></td>
            <td><a href="./files?4-1.ILinkListener-files-3-download">Download</a></td>
        </tr><tr>
            <td><span>zone1</span></td>
            <td><span></span></td>
            <td><span>zds01</span></td>
            <td style="text-align: left"><span>zone01_zdsdb_01_202006020058</span></td>
            <td><span>00:58, 02/Jun/2020</span></td>
            <td><a href="./files?4-1.ILinkListener-files-4-download">Download</a></td>
        </tr>
        <tr>
            <td colspan="6"><span>

the one I want to click is 

<A href="./files?4-1.ILinkListener-files-1-download">Download</A>

I click it based row that have specific Application Name; 

Func FindRow($oTable, $keyWord)
   IEexist_2()
   $windowTitle = _IEPropertyGet($oIE, "title")
   resetState($windowTitle)

   $aTableData = _IETableWriteToArray($oTable)
;~    Local $arrayDisplay = _ArrayDisplay($aTableData)

    Local $oTds
    Local $oTrs = $oTable.rows
    For $oTr In $oTrs
        $oTds = $oTr.cells
        For $oTd In $oTds

            if(StringCompare($oTd.innerText, $keyWord)=0) Then
                _writeLog("found the row with expected keyword: <"& $keyWord&">, current shown: <"& $oTd.innerText&">")
                Return $oTr
            EndIf
        Next
     Next
     IEexist_2()
     $windowTitle = _IEPropertyGet($oIE, "title")
      resetState($windowTitle)
EndFunc

 

Link to post
Share on other sites

Ok, tested on the IE Table Example and it is working well :

Local $oIE = _IE_ExampleEX("table")
  _IELoadWait($oIE)
  Local $oTable = _IETableGetCollection($oIE, 1)
  Local $cTags = _IETagNameGetCollection($oTable, "a")
  For $oTag in $cTags
    If StringInStr ($oTag.href, "./files?4-1.ILinkListener-files-2-download") Then
      ConsoleWrite ("found" & @CRLF)
      $oTag.click ()
      _IELoadWait($oIE)
      Return $oTag
    EndIf
  Next

 

Link to post
Share on other sites
33 minutes ago, Nine said:

Ok, tested on the IE Table Example and it is working well :

Local $oIE = _IE_ExampleEX("table")
  _IELoadWait($oIE)
  Local $oTable = _IETableGetCollection($oIE, 1)
  Local $cTags = _IETagNameGetCollection($oTable, "a")
  For $oTag in $cTags
    If StringInStr ($oTag.href, "./files?4-1.ILinkListener-files-2-download") Then
      ConsoleWrite ("found" & @CRLF)
      $oTag.click ()
      _IELoadWait($oIE)
      Return $oTag
    EndIf
  Next

Mine stucked at  

_IELoadWait($oIE)

Could be because my IE run in background?

 

Edited by triple_N
Link to post
Share on other sites
1 hour ago, Nine said:

Ok, tested on the IE Table Example and it is working well :

Local $oIE = _IE_ExampleEX("table")
  _IELoadWait($oIE)
  Local $oTable = _IETableGetCollection($oIE, 1)
  Local $cTags = _IETagNameGetCollection($oTable, "a")
  For $oTag in $cTags
    If StringInStr ($oTag.href, "./files?4-1.ILinkListener-files-2-download") Then
      ConsoleWrite ("found" & @CRLF)
      $oTag.click ()
      _IELoadWait($oIE)
      Return $oTag
    EndIf
  Next

 

I replace 

_IEAction($oElement, "click")

with 

$oElement.click ()

As I believe it did found the link based below result:

Found table with expected keyword: <Download>
Found expected column header: File Name
found the row with expected keyword: <ucs01>, current shown: <ucs01>

Action Success perform - click on selected link: Download
Success to click Download

.

However, I'm waiting "Frame Notification Bar" class from wingetclasslist that indicate there is IE popup save dialog after successful click the link . 

But never exists ;(

Link to post
Share on other sites

I cannot replicate your issue since I do not have access to your site.  Try to run it visible first until you know it is working properly. If the download bar should appear, you need to make it visible before clicking the link, otherwise it will not work. 

Link to post
Share on other sites
8 hours ago, Nine said:

I cannot replicate your issue since I do not have access to your site.  Try to run it visible first until you know it is working properly. If the download bar should appear, you need to make it visible before clicking the link, otherwise it will not work. 

There is no problem when running with visible mode. Only when run in background even though return 1;

$status_click = _IEAction($oElement, "click")
Sleep(1000)
    If ($status_click = 1) Then
     _writeLog("Action Success perform - click on selected link: "&$keyWord)
    Else
     _writeLog("failed perform Action Link")
    EndIf

Still there is no Frame Notification Bar exists.

Does _IEAction not work in background? Any alternative ways?

Link to post
Share on other sites

When you say no Frame Notification, you mean no Download bar at the bottom of the screen, right ? As I already told you, it is not possible to access the download window when not visible.  But it is possible to simulate it by blocking all inputs (so user cannot interfere) and making the window fully transparent.

Link to post
Share on other sites
5 minutes ago, Nine said:

When you say no Frame Notification, you mean no Download bar at the bottom of the screen, right ? As I already told you, it is not possible to access the download window when not visible.  

Yes, admit the fact. Thank you.

5 minutes ago, Nine said:

But it is possible to simulate it by blocking all inputs (so user cannot interfere) and making the window fully transparent.

I tried 

__IELockSetForegroundWindow($LSFW_LOCK)

But result still same

Link to post
Share on other sites

Here the code I use :

#include <IE.au3>
#include "..\BlockInput\BlockInputEx.au3" ; ;https://www.autoitscript.com/forum/topic/199762-udf-blockinputex/

$oIE = _IECreate("Your URL here", 0, 0)
$oObj = _IEGetObjById($oIE, "The object you want to download")
_IEAction($oObj, "click")

Sleep (1000)

Local $hWnd= _IEPropertyGet ($oIE, "hwnd")
Local $hCtrl = ControlGetHandle ($hWnd, "", "DirectUIHWND1")
ConsoleWrite ("Control = " & $hCtrl & @CRLF)
WinSetTrans ($hWnd, "", 0)

_BlockInput ($BI_DISABLE)
$oIE.visible = True
WinActivate ($hWnd)
Sleep (800)
ControlSend ($hWnd, "", $hCtrl, "{F6}{TAB}")
Sleep (800)
ControlSend ($hWnd, "", $hCtrl, "{ENTER}")
$oIE.visible = False
_BlockInput ($BI_ENABLE)

 

Link to post
Share on other sites
2 hours ago, Nine said:

Here the code I use :

#include <IE.au3>
#include "..\BlockInput\BlockInputEx.au3" ; ;https://www.autoitscript.com/forum/topic/199762-udf-blockinputex/

$oIE = _IECreate("Your URL here", 0, 0)
$oObj = _IEGetObjById($oIE, "The object you want to download")
_IEAction($oObj, "click")

Sleep (1000)

Local $hWnd= _IEPropertyGet ($oIE, "hwnd")
Local $hCtrl = ControlGetHandle ($hWnd, "", "DirectUIHWND1")
ConsoleWrite ("Control = " & $hCtrl & @CRLF)
WinSetTrans ($hWnd, "", 0)

_BlockInput ($BI_DISABLE)
$oIE.visible = True
WinActivate ($hWnd)
Sleep (800)
ControlSend ($hWnd, "", $hCtrl, "{F6}{TAB}")
Sleep (800)
ControlSend ($hWnd, "", $hCtrl, "{ENTER}")
$oIE.visible = False
_BlockInput ($BI_ENABLE)

Nothing downloaded. I'm not sure but I guess the 

_IEAction($oObj, "click")

is the problem because as I'm mention earlier when I run WinGetClassList command which should works on both minimized and hidden windows after click the link, the "Frame Notification Bar" class not exists even though click return "1" means successful. Not sure due to IE security or what. 

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By iamtech
      i tried to print ie windows with my default printer  using
      _IEAction ($oIE, "printdefault") but it was not working sometimes, autoit icon showing in tray but not printing anything.
    • By XinYoung
      For fun, I'm building an app that opens a webpage and refreshes it every 30 seconds.
      But once the script performs _IEAction($oIE, "refresh"), the GUI closes.
      Any help is appreciated.
       

      #include <ButtonConstants.au3>
      #include <EditConstants.au3>
      #include <GUIConstantsEx.au3>
      #include <StaticConstants.au3>
      #include <WindowsConstants.au3>
      #include <WinAPIFiles.au3>
      #include <Array.au3>
      #include <File.au3>
      #include <Excel.au3>
      #include <DateTimeConstants.au3>
      #include <MsgBoxConstants.au3>
      #include <WinAPIShellEx.au3>
      #include <MsgBoxConstants.au3>
      #include <Date.au3>
      #include <ComboConstants.au3>
      #include <guimenu.au3>
      #include <IE.au3>
      HotKeySet("{F4}", "_Exit")
      ;Open the file(s) in the selected folder
      $extension = ".txt"
      $app2openWith = @SystemDir & "\notepad.exe"
      Func Begin()
          Global $loopTrick = 0
          #Region ### START Koda GUI section ### Form=c:\users\mchu\downloads\autoit\my code\form1.kxf
          Global $UI = GUICreate("Hit Em Up!", 256, 113, -1, -1)
          GUISetBkColor(0x000000)
          $menu = _GUICtrlMenu_GetSystemMenu($UI)
          _GUICtrlMenu_EnableMenuItem($menu, $SC_CLOSE, 1, False)
          Global $url = GUICtrlCreateInput("https://www.youtube.com/watch?v=dQw4w9WgXcQ", 81, 8, 160, 21)
          $Label1 = GUICtrlCreateLabel("Target:", 16, 8, 55, 17)
          GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
          GUICtrlSetColor(-1, 0x00FF00)
          Global $StartBut = GUICtrlCreateButton("Start", 16, 40, 67, 25)
          GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
          GUICtrlSetBkColor(-1, 0x008000)
          $Label2 = GUICtrlCreateLabel("(Press F4 to Exit)", 96, 40, 8000, 17)
          GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
          GUICtrlSetColor(-1, 0x00FF00)
          GUISetState(@SW_SHOW)
          #EndRegion ### END Koda GUI section ###
          While 1
              $UIfunc = GUIGetMsg()
              Select
                  Case $UIfunc = $GUI_EVENT_CLOSE
                      _Exit()
                  Case $UIfunc = $StartBut
                      If GUICtrlRead($url) = "" Then
                          MsgBox(48, "Um...", "Give me a target you idiot.")
                      Else
                          GUICtrlSetState($url, $GUI_DISABLE)
                          GUICtrlSetState($StartBut, $GUI_DISABLE)
                          Start()
                      EndIf
              EndSelect
          WEnd
      EndFunc   ;==>Begin
      Func Start()
          If $loopTrick = 0 Then
              Global $oIE = _IECreate(GUICtrlRead($url))
              _IELoadWait($oIE)
              Again()
          ElseIf $loopTrick = 1 Then
              Sleep(3000)
              _IEAction($oIE, "refresh")
              Sleep(3000)
              Start()
          EndIf
      EndFunc   ;==>Start
      Func Again()
          $loopTrick = 1
          Start()
      EndFunc   ;==>Again
      Func _Exit()
          Exit
      EndFunc   ;==>_Exit
    • By PINTO1927
      Hello guys,
      I need to bring up a MsgBox when the user clicks a button on the Internet Explorer page.
      This is the button on the HTML page:
      <button id="NOT_READY_BTN-btnEl" type="button" class="x-btn-center" hidefocus="true" disabled="disabled" role="button" autocomplete="off" data-qtip="ENTRA" style="width: 169px; height: 24px;"> <span id="NOT_READY_BTN-btnInnerEl" class="x-btn-inner" style="width: 169px;">ENTRA</span> <span id="NOT_READY_BTN-btnIconEl" class="x-btn-icon " style="background-image:url(img/icons/ENTRA.gif)"></span></button> Thanks
    • By PaLmeTToX
      <td align="right"> <script language="JavaScript"> DrawActionTableTop(); DrawActionRow('sign in','#"onClick="JavaScript:doit()',2 ); DrawActionTableBottom(); </script>I am trying to do a simple login to a webpage. When i view the source of the web page it shows ^^^^
       
      Further in the source the function that it is calling is 
      function doit() { if(validate()) document.loginFormBean.submit(); } 
      My following Autoit code of course is not working to submit the page
      $oButton=_IEGetObjById($oIE,"sign in") _IEAction ($oButton, "click")How would I click on this button or can i run this command somehow? Sorry for all the code boxes, i could not delete them once added.
      document.loginFormBean.submit();
    • By zemkor
      Hello, i need your help again. How click on button in form if buttons have same name ? Button value is different. 
      My script not working
      func odoslat() Local $oForm = _IEFormGetObjByName($oIE, "formedit") Local $oSelect = _IEFormElementGetObjByName($oForm, "Zmazať") _IEAction($oSelect, "focus") _IEAction($oSelect, "click") EndFuncSource code from web is here: I need click on button "Zmazať"
      <form name="formedit" id="formedit" method="post" action="/deletei2.php"> <br> Vaše heslo:<br> <input type="text" name="heslobazar" maxlength="20" value=""><br><br> <input type="hidden" name="idad" id="idad" value=49359062> <input type="submit" name="administrace" value="Editovať"> <input type="submit" name="administrace" value="Zmazať"> </form> </td> </tr>Thanks for answer
×
×
  • Create New...