Sign in to follow this  
Followers 0
DrewSS

javascript menu automation help - _FFCmd

7 posts in this topic

Hello,

I'm looking for some direction with how to automate the exporting of an excel report through a javascript driven menu; unfortunately it does not support IE, so Firefox is what i've been trying, and I can navigate all the way through the dashboard and generate the report, but to export it I need to go through the menu. The menu has onmousedown and onmouseover events that I'm not sure how to send. It looks like I can do this with _FFCmd, but it may take several statements.. can someone help me get started?

 

This is the path to export:

 

<div id="mstr395" tstid="" class="mstrmojo-ListBase mstrmojo-ui-Menu unselectable mojo-theme-dark visible" style="top: 0px; right: 100%; bottom: auto; left: auto;"
onclick="mstrmojo.dom.captureDomEvent('mstr395','click', self, event)"
ondblclick="mstrmojo.dom.captureDomEvent('mstr395','dblclick', self, event)"
onmousedown="mstrmojo.dom.captureDomEvent('mstr395','mousedown', self, event)"
onmouseover="mstrmojo.dom.captureDomEvent('mstr395','mouseover', self, event)"
onmouseout="mstrmojo.dom.captureDomEvent('mstr395','mouseout', self, event)"
oncontextmenu="mstrmojo.dom.captureDomEvent('mstr395','contextmenu', self, event)">

<div class="mstrmojo-ui-Menu-item-container" style="">
<a class="item exportToExcel mstrmojo-ui-Menu-item" idx="0" style="" title="">
<div class="micn"></div>Excel</a><a class="item exportToPDF mstrmojo-ui-Menu-item" idx="1" style="" title="">

 

Sorry I cannot provide access to the dashboard as it has sensitive information. Any feedback is greatly appreciated!

 

 

 

 

 

Share this post


Link to post
Share on other sites



Not sure how helpful we can be with the limited information, but you could try something like this:

$oDiv = _FFXPath("//input[@id='mstr395']")
_FFCmd("FFau3.xpath.onclick()")

 

1 person likes this

Share this post


Link to post
Share on other sites

Thank you; that gives me a better understanding of the syntax and stuff.

Share this post


Link to post
Share on other sites

FWIW, the first line of code should actually read:

$oDiv = _FFXPath("//div[@id='mstr395']")

Copy / paste. :shifty:

1 person likes this

Share this post


Link to post
Share on other sites

Interesting... it's finding the Xpath, but the onclick syntax does not appear to be correct:

 

    $oDiv = _FFXPath("//DIV[@class='icn']")
    _FFCmd("FFau3.xpath.onclick()")

 

logs:

__FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate("//DIV[@class='icn']",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;};
__FFRecv: [object HTMLDivElement] - {align: "", click: function() {...}, focus: function() {...}, blur: function() {...}, title: "", lang: "", dir: "", ...}
__FFSend: try{FFau3.xpath.onclick()}catch(e){'_FFCmd_Err';};

 

 

 

Share this post


Link to post
Share on other sites

Nothing that you posted shows any kind of error.

Was there something after this line?:

__FFSend: try{FFau3.xpath.onclick()}catch(e){'_FFCmd_Err';};

 

Share this post


Link to post
Share on other sites

 

Thanks so much for your help Danp2!

Unfortunately that was the last statement in the log provided by FF. I have not had any more time to play around since then, but I have a few more ideas.

Would you happen to know if/what any common terminology might be that I can use to investigate what I am trying to learn?

 

 

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  
Followers 0

  • Similar Content

    • Chimp
      By Chimp
      An example on how to inject jQuery into a web page
      It can be useful to manage the page from AutoIt using jQuery.
      Idea from here: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet
      Suggestions and improvements are welcome
      #include <ie.au3> Example() Func Example() Local $oIE = _IECreate("www.google.com") Local $jQuery = _jQuerify($oIE) MsgBox(0, "Version", "jQuery version: " & $jQuery.fn.jquery) MsgBox(0, "Example", "click ok to exit." & @CRLF & "Google logo will fade out by jQuery...") $jQuery('#hplogo').fadeOut(3000) ; jQuery will fade out the google logo EndFunc ;==>Example ; #FUNCTION# ==================================================================================================================== ; Name ..........: _jQuerify ; Description ...: ; Syntax ........: _jQuerify(Byref $oIE) ; Parameters ....: $oIE - Object variable of an InternetExplorer.Application. ; Return values .: an object variable pointing to the jQuery library ; Author ........: Chimp ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _jQuerify(ByRef $oIE) Local $jsEval, $jQuery, $otherlib = False ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('document.head.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.head.eval') Until IsObj($jsEval) ; if jQuery is not already loaded then load it If $jsEval("typeof jQuery=='undefined'") Then ; check if the '$' (dollar) name is already in use by other library If $jsEval("typeof $=='function'") Then $otherlib = True Local $oScript = $oIE.document.createElement('script'); $oScript.type = 'text/javascript' ; If you want to load jQuery from a disk file use the following statement ; where i.e. jquery-1.9.1.js is the file containing the jQuery source ; (or also use a string variable containing the whole jQuery listing) ;~ $oScript.TextContent = FileRead(@ScriptDir & "\jquery-1.9.1.js") ; <--- from a file ; If you want to download jQuery from the web use this statement $oScript.src = 'https://code.jquery.com/jquery-latest.min.js' ; <--- from an url $oIE.document.getElementsByTagName('head').item(0).appendChild($oScript) Do Sleep(250) Until $jsEval("typeof jQuery == 'function'") EndIf Do Sleep(250) $jQuery = $jsEval("jQuery") Until IsObj($jQuery) If $otherlib Then $jsEval('jQuery.noConflict();') Return $jQuery EndFunc ;==>_jQuerify  
    • XaelloNegative
      By XaelloNegative
      Hi there.
      Im having some kind of a coder block here, 
      <td class="treeview ctl00_CenterContent_objTreeView_2" style="white-space:nowrap;"> <input type="checkbox" name="ctl00_CenterContent_objTreeViewn1CheckBox" id="ctl00_CenterContent_objTreeViewn1CheckBox"> <span class="ctl00_CenterContent_objTreeView_0 treeview ctl00_CenterContent_objTreeView_1" id="ctl00_CenterContent_objTreeViewt1" style="border-style:none;font-size:1em;"> <i class="fa fa-file-code-o fa-fw"> </i> <span data-placement="bottom" data-toggle="tooltip" title="" data-original-title="Tool tip for said part">REFUNDS</span></span></td> this is a code directly from the website im working with. I was thinking of inserting a javascript that would get the "REFUNDS" part. Any ideas on how to do so?
      Any thoughts will be highly appreciated.
    • mattia100
      By mattia100
      HI!
      1) I want to create a FF web page in background... i want to say a web page that can't be seen in the application bar  but only in Windows Task Manager... 
      maybe using  __FFStartProcess? in fact i tried to use it but the parameter "hide" only can minimize the page, but not put it in background... 
      2) After creating this hide page, i would to open a macro of the iMacros addon, always all in hide mode...
      it is possible to do it?
      anybody can help me?
      Thanks!!
    • Marc
      By Marc
      Profiler - yet another backup script for Firefox and Thunderbird profiles
      It automatically detects the last recently used profile directories of Firefox and Thunderbird (installed versions, no portables).
      Clicking the Backup-Button creates a complete Backup of the found profiles with a timestamp.
      Restore deletes the according profile dir and extracts the content of the selected archive into the profile directory.
      Uses Winrar as compression tool, but feel free to change it to your needs
      Best regards
      Marc

      Profiler.au3
    • BOUNCER
      By BOUNCER
      I'm trying to get the output data from https://www.guilded.gg but it uses a web app that generates that output on the fly and this doesn't show up in the page source.
      Only in web inspector of each browser does this data show up. How do I read this data in autoit (equivalent to the web inspector)
       
      thank you