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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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
 Share

×
×
  • Create New...