Jump to content

click on Document List in SAP Businessobject Infoview


Recommended Posts

49 minutes ago, MRAJ said:

Its not working still.

Your reply is about as helpful as my code. :blink:

Looking at the html, it appears that the site is using an older version of the YUI library, which can be tricky to automate. My only suggestion at this stage is for you to use the browser's console (I prefer Firefox for this) to interact with the control to determine the steps to manually trigger the desired action. Once you can do it manually from the console, then it should be easier to automate.

Link to comment
Share on other sites

I didnt understand this (control to determine the steps to manually trigger the desired action. Once you can do it manually from the console, then it should be easier to automate.)

is there any command other then IENavigate, which will take the other page but parent URL should be same.

Link to comment
Share on other sites

@MRAJ This is what I was suggesting that you do --

  • Load the website in Firefox
  • Navigate to the page containing the Public Folders link
  • Right click on this link and select "Inspect Element" from the popup menu

This will open the Developer Tools with the desired element already highlighted.

  • Right click on the highlighted link entry in the Developers Tools window and select "Use in Console" from the popup window

This will give you a variable (likely named `temp0') that will allow you to try different commands with this control, such as --

temp0.click()
temp0.onclick()

If neither of those work, then try something like this, which came directly from the HTML file you posted --

YAHOO.widget.TreeView.getNode('ListingURE_treeContent_Inner',4).toggle()

All of this is done directly in the browser window; no need for Autoit until you can figure out how to manually perform the desired action.

Link to comment
Share on other sites

If you have found it you know x y and w h so you can move mouse and click. Many elements in modern js frameworks have a mirrored shadow tree (https://www.w3.org/TR/shadow-dom/) so directly calling click event will not trigger the js code as on the span itself there is no click code event.

Simplespy helps partly in this as it will give you the id a little easier the ie get collection functions (see next post for example code).

Edited by junkew
Link to comment
Share on other sites

example

#include <IE.au3>
Local $oIE = ObjCreate("InternetExplorer.Application")

If @error Then
    MsgBox($MB_SYSTEMMODAL, "", "Error opening Internet Explorer: " & @error)
    Exit
EndIf

$oIE.Visible = 1
$oie.navigate2("about:blank")

Local $sHTML = ''
$sHTML &= '<!DOCTYPE html>' & @CR
$sHTML &= '<html>' & @CR
$sHTML &= '<head>' & @CR
$sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
$sHTML &= '<title>Span example</title>' & @CR
$sHTML &= '</head>' & @CR
$sHTML &= '<body>Hello world... wait a moment will add some spans' & @CR 
$sHTML &= '</body>' & @CR
$sHTML &= '</html>'
    
$oie.document.body.innerhtml=$sHtml
;~ sleep(2000)

$sHTML &= '<!DOCTYPE html>' & @CR
$sHTML &= '<html>' & @CR
$sHTML &= '<head>' & @CR
$sHTML &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
$sHTML &= '<title>Span example</title>' & @CR
$sHTML &= '</head>' & @CR
$sHTML &= '<body>Hello world... Wait I will move some spans with mouse' & @CR 
local $i=0
for $i=1 to 10
    $shtml &= '<span> span ' & $i & '</span><br>' & @CR
Next
$sHTML &= '</body>' & @CR
$sHTML &= '</html>'

$oie.document.body.innerhtml=$sHtml
;~ sleep(2000)

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

In general I would advice to use internet explorer first from a VBA macro (with references to Microsoft Internet Controls (Internetexplorer.application) and microsoft html controls as with the debugger its much easier to inspect the tree and all properties. Learning IE object model from within AutoIt can be painfull and time consuming.

in above example I am 99% sure in your scenario $el.click will not work and as such you have to use mousemove and/or mouseclick or click

Within the loop you can filter with innerhtml, outhtml or any other html property (like id, name, ... ) so instead of using getelementbyid or getelementbyclassname you use getelementsbytagname (in your case its a span but div works fine to)

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...