Click HTML link doesn't do same as clicking HTML link manually. What to try?

177 views
Skip to first unread message

DaveGadgeteer

unread,
May 15, 2012, 3:03:04 PM5/15/12
to Fake, d...@scizzl.com
I'm trying to automate getting some pdf statements each month. I've
managed to log in and open the relevant page, which has three rows in
a table containing "PDF" and "HTML" options for viewing the
statements. When I manually click on "PDF", the appropriate PDF
statement opens in a new tab. But when I use "Click HTML link"
actions, the new tab opens but contains a copy of the original tab's
contents. Not useful.

I've tried using mouse events, but those don't work either.

How can I simulate clicking on the PDF html link so it acts like it
does when I do it manually? What could be screwing this up?

Here's the relevant section of the page source, just showing the first
of the 3 rows of statements:

<tr>
<th scope="col" class="th-border col1">Date</th>
<th scope="col" class="th-border col2">Statement</th>
<th scope="col" class="th-border align-center">View Statement<a
href="javascript:popupHelp('http://personal.fidelity.com/webxpress/
help/topics/learn_portfolio_statements.shtml#differentways',
620,380);">
<img alt="Help" border="0" src="https://scs.fidelity.com/accounts/
mailings/images/11_11_question1.gif"/></a>
</th>
<th scope="col" class="th-border align-center">Viewed</th>
<th scope="col" class="th-border align-center col5">My Notes</th>
<th scope="col" class="th-border align-center col3">Legal Info</th>
<th scope="col" class="th-border no-rt-border align-center
col1">Download</th>
</tr>
<tr class="alternate-row-color" id="cpopup0">
<th scope="row">
<abbr title="04/30/2012">04/30/2012</abbr>
</th>
<td>
Consolidated</td>
<td class="align-center">
<a
href="#cs8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf"
onclick='doTagging("Statements
PDF");getStatement("Y","8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf","04/30/2012");'
title="Print (PDF) format for your April 30, 2012 consolidated
statement. Opens in a new window.">PDF<span class="ofOffScreen">
format for your April 30, 2012 consolidated statement. Opens in a new
window.</span></a>
<span>&#124;</span>
<a
href="#cx8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf"
onclick='doTagging("Statements
HTML");getXmlStatement("8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf",
"04/01/2012", "true", "04/30/2012","n");' title="View your April 30,
2012 consolidated statement in HTML screen format.">HTML<span
class="ofOffScreen"> format for your April 30, 2012 consolidated
statement.</span></a>
</td>
<td class="align-center">
Yes</td>
<td class="align-center">
<a
href="#cv8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf"
title="Add or Edit notes for your April 30, 2012 consolidated
statement. Opens in a new window."
onclick='setValues("04/30/2012","8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf","true","");showhidepops("notes","cpopup0","close1");doTagging("Statements
Notes");'>
Add<span class="ofOffScreen">Add or Edit notes for your April 30, 2012
consolidated statement. Opens in a new window.</span></a>
</td>
<td class="align-center">
<a href
="#l8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf"
onclick='popWindow("https://scs.fidelity.com/accounts/mailings/content/
042012retbacker.html")' title="Legal information about your April 30,
2012 consolidated statement. Opens in a new window.">Legal Info<span
class="ofOffScreen">Legal Info</span></a>
</td>
<td class="no-rt-border align-center">
<a href="/ftgw/fbc/ofstatements/getStatementCsv?
k=8794ad18e339d484b21d4d3e9a81a6a1fc7a00805189f4e6af17143cdcb37dcf&c=04/01/2012&a=true&r=04/30/2012&download=y");'
title="CSV format of your April 30, 2012 consolidated statement. Opens
in a new window." onclick="doTagging('Statements CSV');">CSV<span
class="ofOffScreen">CSV format of your April 30, 2012 consolidated
statement. Opens in a new window.</span></a>
</td>
</tr>

Todd Ditchendorf

unread,
May 15, 2012, 5:09:00 PM5/15/12
to fak...@googlegroups.com, d...@scizzl.com
unfortunately the sequence of JS event handlers which can be called (and in what order) in response to real world clicking/mousing is extremely complex.

i have tried to encapsulate these via the "Click HTML Element" as well as I can. But there are times when even this does not work. 

You may just have to experiment with the "Dispatch Mouse Event" Actions until you can find the magic combination (that's why I've included those Actions too - to make this easier than straight JS code).

keep in mind that a single "click" is actually a sequence of many events something like

mousein
mouseover
mouseover
mouseover
mousedown
mouseup
click
mouseover
mouseover
mouseout

i would try to find the event handler which has the JS you are trying to trigger. Then either find the magic combination to trigger it, or just call the JS function yourself in a "Do JavaScript" Action

someone else may have better advice....

TD
Reply all
Reply to author
Forward
0 new messages