Jump to content

click on Document List in SAP Businessobject Infoview


Recommended Posts

As i am new to autoit and not having depth knowledge..if you can share the script in the zip file which i want for my script to run and click on the Public Folder page that will help me to resolve the issue.

Link to comment
Share on other sites

ok forget iuiautomation ./ zip and just run my shared example from scite and try to understand what its doing.

Then use the last part of that example to iterate over the span elements of your own page.

  • In general you should see your mouse moving over all your span controls and try to click at them.

And last but not least study first the notepad examples in the help files to understand the general concepts of finding elements and doing actions on them.

Its just hard to learn directly IE.UDF (or worse selenium/webbrowser udf) if you do not understand the internal developer tools of a browser or how to work with a (shadow) DOM tree.

 

Link to comment
Share on other sites

You mean to say below part of the script to run in my script:

local $spanElements

$spanElements=$oie.document.getElementsByTagName("span")

consolewrite("Hooray we found " & $spanElements.length & " elements")

local $el
;~ local $boundingRect
for $i=8 to 0 step -2
    $el=$spanelements.item($i)
;~  $boundingRect=$el.getboundingclientrect()
    local $x=_IEPropertyGet($el, "screenx")
    local $y=_IEPropertyGet($el, "screeny")
    mousemove($x, $y)
    mouseclick("left", $x,$y)
    sleep(200)

Next

Link to comment
Share on other sites

Local $oIE = _IECreate($URL,0,1)
Sleep(5000)

Local $hWnd = WinWait("InfoView - Internet Explorer","",5)

Sleep(2000)

ControlClick($hWnd, "InfoView - Internet Explorer", "[CLASS:Internet Explorer_Server; INSTANCE:1]")

Sleep(2000)

Send("{TAB}username{TAB}{TAB}Password{ENTER}")

Sleep(5000)
;script for clicking on Document List
$oFrame = _IEFrameGetCollection($oIE, 0)
$oSpan = _IEGetObjById($oFrame, "IconImg_Txt_btnListing")
_IEAction($oSpan, "click")

Sleep(5000)

;which part of script to put from the shared example to click on Public Folder

Above is my script. Please let me know which part of script to put from the shared example to click on Public Folder.

Link to comment
Share on other sites

Could you please give me complete code of combination of my script and your sample script which you told to combine. For me it is giving error.

Local $oIE = _IECreate($URL,0,1)
Sleep(5000)

Local $hWnd = WinWait("InfoView - Internet Explorer","",5)

Sleep(2000)

ControlClick($hWnd, "InfoView - Internet Explorer", "[CLASS:Internet Explorer_Server; INSTANCE:1]")

Sleep(2000)

Send("{TAB}username{TAB}{TAB}Password{ENTER}")

Sleep(5000)
;script for clicking on Document List
$oFrame = _IEFrameGetCollection($oIE, 0)
$oSpan = _IEGetObjById($oFrame, "IconImg_Txt_btnListing")
_IEAction($oSpan, "click")

Sleep(5000)

local $spanElements

$spanElements=$oie.document.getElementsByTagName("span")

consolewrite("Hooray we found " & $spanElements.length & " elements")

local $el
;~ local $boundingRect
for $i=8 to 0 step -2
    $el=$spanelements.item($i)
;~  $boundingRect=$el.getboundingclientrect()
    local $x=_IEPropertyGet($el, "screenx")
    local $y=_IEPropertyGet($el, "screeny")
    mousemove($x, $y)
    mouseclick("left", $x,$y)
    sleep(200)

Next

Below is the error code:

   
Hooray we found 0 elements--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
>Exit code: 0    Time: 23.67
 

Link to comment
Share on other sites

Local $oIE = _IECreate($URL,0,1)
Sleep(5000)

Local $hWnd = WinWait("InfoView - Internet Explorer","",5)

Sleep(2000)

ControlClick($hWnd, "InfoView - Internet Explorer", "[CLASS:Internet Explorer_Server; INSTANCE:1]")

Sleep(2000)

Send("{TAB}username{TAB}{TAB}Password{ENTER}")

Sleep(5000)
;script for clicking on Document List
$oFrame = _IEFrameGetCollection($oIE, 0)

Local $iNumFrames = @extended
consolewrite("Hooray we found " & $iNumFrames & " frames")

$oSpan = _IEGetObjById($oFrame, "IconImg_Txt_btnListing")
_IEAction($oSpan, "click")

Sleep(5000)

local $spanElements

$spanElements=$oie.document.getElementsByTagName("span")

consolewrite("Hooray we found " & $spanElements.length & " elements")

local $el
;~ local $boundingRect
for $i=8 to 0 step -2
    $el=$spanelements.item($i)
;~  $boundingRect=$el.getboundingclientrect()
    local $x=_IEPropertyGet($el, "screenx")
    local $y=_IEPropertyGet($el, "screeny")
    mousemove($x, $y)
    mouseclick("left", $x,$y)
    sleep(200)

Next

I added this

Local $iNumFrames = @extended
consolewrite("Hooray we found " & $iNumFrames & " frames")

 

Link to comment
Share on other sites

   
Below the output i found after runnning the above script.

Local $oIE = _IECreate($URL,0,1)
Sleep(5000)

Local $hWnd = WinWait("InfoView - Internet Explorer","",5)

Sleep(2000)

ControlClick($hWnd, "InfoView - Internet Explorer", "[CLASS:Internet Explorer_Server; INSTANCE:1]")

Sleep(2000)

Send("{TAB}username{TAB}{TAB}Password{ENTER}")

Sleep(5000)
;script for clicking on Document List
$oFrame = _IEFrameGetCollection($oIE, 0)

Local $iNumFrames = @extended
consolewrite("Hooray we found " & $iNumFrames & " frames")

$oSpan = _IEGetObjById($oFrame, "IconImg_Txt_btnListing")
_IEAction($oSpan, "click")

Sleep(5000)

Local $iNumFrames = @extended
consolewrite("Hooray we found " & $iNumFrames & " frames")

local $spanElements

$spanElements=$oie.document.getElementsByTagName("span")

consolewrite("Hooray we found " & $spanElements.length & " elements")

local $el
;~ local $boundingRect
for $i=8 to 0 step -2
    $el=$spanelements.item($i)
;~  $boundingRect=$el.getboundingclientrect()
    local $x=_IEPropertyGet($el, "screenx")
    local $y=_IEPropertyGet($el, "screeny")
    mousemove($x, $y)
    mouseclick("left", $x,$y)
    sleep(200)

Next

    
Hooray we found 1 framesHooray we found 0 framesHooray we found 0 elements--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
>Exit code: 0    Time: 23.33
 

Link to comment
Share on other sites

maybe page not loaded yet

https://www.autoitscript.com/autoit3/docs/libfunctions/_IELoadWait.htm

try to add this it will dump any tag it can find

$oElements = _IETagNameAllGetCollection ($oIE)
For $oElement In $oElements
  consolewerite($oElement.tagname)
Next

 

Edited by junkew
Link to comment
Share on other sites

Local $iNumFrames = @extended
consolewrite("Hooray we found " & $iNumFrames & " frames")

$oSpan = _IEGetObjById($oFrame, "IconImg_Txt_btnListing")
_IEAction($oSpan, "click")

Sleep(5000)

Local $iNumFrames = @extended
consolewrite("Hooray we found " & $iNumFrames & " frames")

local $spanElements

$spanElements=$oie.document.getElementsByTagName("span")

consolewrite("Hooray we found " & $spanElements.length & " elements")

$oElements = _IETagNameAllGetCollection ($oIE)
For $oElement In $oElements
  consolewrite($oElement.tagname)
Next

local $el
;~ local $boundingRect
for $i=8 to 0 step -2
    $el=$spanelements.item($i)
;~  $boundingRect=$el.getboundingclientrect()
    local $x=_IEPropertyGet($el, "screenx")
    local $y=_IEPropertyGet($el, "screeny")
    mousemove($x, $y)
    mouseclick("left", $x,$y)
    sleep(200)

Next

I tried and got the below output:

    
Hooray we found 1 framesHooray we found 0 framesHooray we found 0 elements!HTMLHEADTITLELINKSCRIPTSCRIPTFRAMESETFRAME--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
>Exit code: 0    Time: 23.69
 

Link to comment
Share on other sites

40 minutes ago, MRAJ said:

HTMLHEADTITLELINKSCRIPTSCRIPTFRAMESETFRAME

This proves that these SPAN elements don't exist on the primary web page, so they must be in the frame. Honestly, it shouldn't take 75+ responses in a forum to figure that out. I find it difficult to understand why you haven't resolved this by now.

Link to comment
Share on other sites

Indeed many posts to get OP in the right direction. @MRAJ as we do not have access to your html page its hard to help.
If you are less experienced with HTML / FRAMES etc. then it can take a while to learn.
It then could be easier to use IUIAutomation but the will also have its own challenges as thats also not a simple library.

this thread can help see example on counting frames over there: 

 

 

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...