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

    • 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
    • Patryk
      By Patryk
      Dear Colleagues,
      I have no idea how to refer to style.display in my loop. There is a button like: 
      <input name="ctl00$bodyPlaceholder$btnFecharProcessamento" class="button" id="bodyPlaceholder_btnFecharProcessamento" style="display: none;" onclick="FecharJanelaProcessamento();return false;" type="submit" value="Fechar"> I want it to be clicked as soon as button's style change from style="display: none;" to  style= ="display: inline-block;" 
      This is what I got, but it's not working...
      Func GetButtons() $oButtons = _IEGetObjByName($oForm,"ctl00$bodyPlaceholder$btnFecharProcessamento",-1) $i = 0 While $i <> 1 For $oBtn In $oButtons If _IEFormElementGetValue($oBtn) = "Fechar" And $oBtn.document.style.display = "display: inline-block;" Then $i = 1 _IEAction($oBtn, "focus") _IEAction($oBtn, "click") ExitLoop EndIf Next WEnd EndFunc  
      I will really appreciate if you could help me with these loop!
    • Pao
      By Pao
      Hello, I've recently updated from Firefox 50 to 54.0.1.
      My Autoit script that previously worked fine, now seems to have erratic problems.
      It's almost as if some Send() commands are sometimes skipped when dealing with the Firefox UI (it's still mostly fine on the actual pages).

      To temporarly fix the problem, I had to put some Sleep(200) pauses and avoid grouping keys together (e.g: TAB 2), but I'm not exactly sure about the correct way to deal with this..
      Could this be caused by the new multiprocess feature? (e10s)
      Are there better Autoit commands or rules that I should use?