AutoHotkey Community

It is currently May 27th, 2012, 5:45 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: March 16th, 2010, 11:57 pm 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
I am in the middle of writing some Javascript automation for a site. Everything else on the site has a standard DOM address, and is easily automated through COM (thanks Sean!). There is one item that DOM inspectors show as an UltraWebMenu, and everything in the menu lacks a formId.

Is anyone familiar with this? Can it be automated through COM?

Code:
; This is the top level node
form id="form1"
div id="raMenu"
table id="igUltraWebMenu_MainM" class="igmnMenuGroup"
tbody
tr
td
table id="igUltraWebMenu_3" class="igmnTopMenuItem

;this is the subitem I want to click on
div id="igUltraWebMenu_3_3M" class=" igmnMenuGroup"
div
table class=" igmnMenuGroup"
tbody
tr
td
table id="igUltraWebMenu_3_3_2" class="igmnMenuItem"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 12:04 am 
Do you have a link, or the full HTML? I would assume something like:
Code:
javascript: document.all['igUltraWebMenu_3_3M'].click()


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 12:53 am 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
The page requires a login, and I would not be able to provide credentials to the community here. I would not feel posting the html would be a good idea either.

Sorry, I know that doesn't help much.

I tried that code, it did not work.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 9:41 pm 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
I think this is as good as I will be able to do.

This is the source code containing the element.

Code:
<div id="abs_igUltraWebMenu" style="display:none"> <div container='1' style='overflow:hidden;position:absolute;visibility:hidden;display:none;z-index:12000;'> <div submenu='1'id='igUltraWebMenu_1M' class=" igmnMenuGroup" style='position:relative;'igLevel='1'> <div scrollDiv=1><table border='0' cellpadding='1' cellspacing='0' class=" igmnMenuGroup" style='border-width:0;'> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_1_1' igTag='print'  ighovimage='/images/buttons/Print.gif' igHov='igmnMenuItemHover'igUrl="JavaScript:print();" class="igmnMenuItem  ig_c5d31239_r2"> <tr><td width='25px' ><img  src='/images/buttons/Print.gif'></td><td igtxt='1'> <nobr>Print</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_1_2' igTag='export'  igDisabled='1' ighovimage='/images/buttons/Export_disabled.gif' igHov='igmnMenuItemHover' igDisabled='1' class="igmnDisabledMenuItem"> <tr><td width='25px' ><img  src='/images/buttons/Export_disabled.gif'></td><td igtxt='1'> <nobr>Export</nobr> </td><td width="15"></td></tr></table></td></tr> </table></div></div></div>  <div container='1' style='overflow:hidden;position:absolute;visibility:hidden;display:none;z-index:12000;'> <div submenu='1'id='igUltraWebMenu_2M' class=" igmnMenuGroup" style='position:relative;'igLevel='1'> <div scrollDiv=1><table border='0' cellpadding='1' cellspacing='0' class=" igmnMenuGroup" style='border-width:0;'> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_2_1' igTag='report'  igDisabled='1' ighovimage='/images/buttons/Report_disabled.gif' igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" igDisabled='1' class="igmnDisabledMenuItem"> <tr><td width='25px' ><img  src='/images/buttons/Report_disabled.gif'></td><td igtxt='1'> <nobr>Report</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_2_2' igTag='graph'  igDisabled='1' ighovimage='/images/buttons/Graph_disabled.gif' igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" igDisabled='1' class="igmnDisabledMenuItem"> <tr><td width='25px' ><img  src='/images/buttons/Graph_disabled.gif'></td><td igtxt='1'> <nobr>Graph</nobr> </td><td width="15"></td></tr></table></td></tr> </table></div></div></div>  <div container='1' style='overflow:hidden;position:absolute;visibility:hidden;display:none;z-index:12000;'> <div submenu='1'id='igUltraWebMenu_3M' class=" igmnMenuGroup" style='position:relative;'igLevel='1'> <div scrollDiv=1><table border='0' cellpadding='1' cellspacing='0' class=" igmnMenuGroup" style='border-width:0;'> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_1' igTag='transfer'  igHov='igmnMenuItemHover' igChildId='igUltraWebMenu_3_1M'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>Transfer</nobr> </td><td width="15"><img  align="right" src="/RS/RSRACS/WebResource.axd?d=EGtcRqcG9_TMglwFnZqcriW2FGYp8uvxJ7XqTvZ8CvrKR2DrnlMtWP4AmPU3k4qalBk3nqvOmEPPYJvkYg63Q_0q8YSuplNrjDJtH6bf16hf2zE3xmMGRfZapHe2FKJzeasyqUHhJI5n7ceBChOAunlKKhCNBSyvb9gfDyygcAt-C3c7226TCYa1ADdl98vk0&t=633289117043928982"> </td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_2' igTag='email'  igHov='igmnMenuItemHover' igChildId='igUltraWebMenu_3_2M'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>Email</nobr> </td><td width="15"><img  align="right" src="/RS/RSRACS/WebResource.axd?d=EGtcRqcG9_TMglwFnZqcriW2FGYp8uvxJ7XqTvZ8CvrKR2DrnlMtWP4AmPU3k4qalBk3nqvOmEPPYJvkYg63Q_0q8YSuplNrjDJtH6bf16hf2zE3xmMGRfZapHe2FKJzeasyqUHhJI5n7ceBChOAunlKKhCNBSyvb9gfDyygcAt-C3c7226TCYa1ADdl98vk0&t=633289117043928982"> </td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_3' igTag='return'  igHov='igmnMenuItemHover' igChildId='igUltraWebMenu_3_3M'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>Return to Dispatch</nobr> </td><td width="15"><img  align="right" src="/RS/RSRACS/WebResource.axd?d=EGtcRqcG9_TMglwFnZqcriW2FGYp8uvxJ7XqTvZ8CvrKR2DrnlMtWP4AmPU3k4qalBk3nqvOmEPPYJvkYg63Q_0q8YSuplNrjDJtH6bf16hf2zE3xmMGRfZapHe2FKJzeasyqUHhJI5n7ceBChOAunlKKhCNBSyvb9gfDyygcAt-C3c7226TCYa1ADdl98vk0&t=633289117043928982"> </td></tr></table></td></tr> </table></div></div></div>  <div container='1' style='overflow:hidden;position:absolute;visibility:hidden;display:none;z-index:12000;'> <div submenu='1'id='igUltraWebMenu_3_1M' class=" igmnMenuGroup" style='position:relative;'> <div scrollDiv=1><table border='0' cellpadding='1' cellspacing='0' class=" igmnMenuGroup" style='border-width:0;'> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_1_1' igTag='ACCDIS'  igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>ACCOUNTING (AC)</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_1_2' igTag='CATDIS'  igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>CATEGORY MANAGEMENT (CM)</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_1_3' igTag='DPODIS'  igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>DEPOT (DP)</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_1_4' igTag='OPRDIS'  igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>OPERATIONAL (OP)</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_1_5' igTag='STODIS'  igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>STORE OPERATIONS (SO)</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_1_6' igTag='TPSDIS'  igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>THIRD PARTY OPERATOR (TP)</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_1_7' igTag='DISD10'  igHov='igmnMenuItemHover'igUrl="JavaScript:menuItemClicked();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>DISTRIBUTION (10)</nobr> </td><td width="15"></td></tr></table></td></tr> </table></div></div></div>  <div container='1' style='overflow:hidden;position:absolute;visibility:hidden;display:none;z-index:12000;'> <div submenu='1'id='igUltraWebMenu_3_2M' class=" igmnMenuGroup" style='position:relative;'> <div scrollDiv=1><table border='0' cellpadding='1' cellspacing='0' class=" igmnMenuGroup" style='border-width:0;'> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_2_1' igTag='reminder'  igHov='igmnMenuItemHover'igUrl="JavaScript:showDatePage('DateReminder.aspx');" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>Set Reminder</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_2_2' igTag='internal'  igHov='igmnMenuItemHover'igUrl="JavaScript:mailInternal();" class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>RA Internal</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_2_3' igTag='service'  igHov='igmnMenuItemHover' class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>Service Provider</nobr> </td><td width="15"></td></tr></table></td></tr> </table></div></div></div>  <div container='1' style='overflow:hidden;position:absolute;visibility:hidden;display:none;z-index:12000;'> <div submenu='1'id='igUltraWebMenu_3_3M' class=" igmnMenuGroup" style='position:relative;'> <div scrollDiv=1><table border='0' cellpadding='1' cellspacing='0' class=" igmnMenuGroup" style='border-width:0;'> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_3_1' igTag='CM'  igHov='igmnMenuItemHover' class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>CATDIS</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_3_2' igTag='FT'  igHov='igmnMenuItemHover' class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>FTSDIS</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_3_3' igTag='OP'  igHov='igmnMenuItemHover' class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>OPRDIS</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_3_4' igTag='SC'  igHov='igmnMenuItemHover' class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>SUPDIS</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_3_5' igTag='SO'  igHov='igmnMenuItemHover' class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>STODIS</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_3_6' igTag='10'  igHov='igmnMenuItemHover' class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>DISD10</nobr> </td><td width="15"></td></tr></table></td></tr> </table></div></div></div>  <div container='1' style='overflow:hidden;position:absolute;visibility:hidden;display:none;z-index:12000;'> <div submenu='1'id='igUltraWebMenu_4M' class=" igmnMenuGroup" style='position:relative;'igLevel='1'> <div scrollDiv=1><table border='0' cellpadding='1' cellspacing='0' class=" igmnMenuGroup" style='border-width:0;'> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_4_1' igTag='help'  ighovimage='/images/buttons/help.gif' igHov='igmnMenuItemHover'igUrl="JavaScript:showHelpPage('Help.htm');" class="igmnMenuItem  ig_c5d31239_r2"> <tr><td width='25px' ><img  src='/images/buttons/help.gif'></td><td igtxt='1'> <nobr>Help</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_4_2' igTag='getstarted'  igDisabled='1' igHov='igmnMenuItemHover'igUrl="JavaScript:showHelpPage('GetStarted.htm');" igDisabled='1' class="igmnDisabledMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>Getting Started</nobr> </td><td width="15"></td></tr></table></td></tr> <tr igitem='1'><td><table width='100%' igSep='1' id='igUltraWebMenu_4_3'><tr><td class='igmnMenuBreak'></td></tr></table></td></tr><tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_4_4' igTag='about'  igHov='igmnMenuItemHover'igUrl="JavaScript:showAboutPage('HelpAbout.htm');" class="igmnMenuItem  ig_c5d31239_r2"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>About RSRACS</nobr> </td><td width="15"></td></tr></table></td></tr> </table></div></div></div> </div>


Here is what it looks like (sensitive information redacted), as well as some images of what different inspection tools display when hovering over it. As you can see, most of the normal information is missing. The id shown in the AHK tool is not reliable, it changes depending on other content on the page.

Note, the menu is hover based (sub-menus expand when you hover over their parent), and only bottom level items respond to clicks.


Image
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 9:58 pm 
It might just be my computer, but if I save that to an html file & open it, I get a blank webpage.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 10:29 pm 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
It is probably very tied into the rest of the page.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 10:33 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
Code:
javascript: document.all[226].click()
try cklicking the index

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 12:13 am 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
The index number is not reliable. It changes based on dynamic page contents. Though always inbetween 224-229, its usually never the same twice.

I did try after getting the index though, and it did not work. If I try the click command through com, it says the element is hidden or does not accept that command.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 2:02 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
you could see if the index of the NOBR tagis consistent
document.all.tags[NOBR].item[somenumber].click

you may need to be creative is there consistant text thats unique within it or directly adjacent etc?

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 2:15 am 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
According to the Source the NOBR tag for that item is FTSDIS. Though I do not know what an NOBR tag is.

I tried that command as the following, but to no effect. I am probably not entering it correctly.

document.all.tags[FTSDIS].item[0].click
document.all.tags[FTSDIS].item[1].click
document.all.tags['FTSDIS'].item[0].click
document.all.tags['FTSDIS'].item[1].click

I am not sure what the item number is referring to, or where to get it. This is the section I found the NOBR tag, and it has an igitem, if that helps you at all.
Code:
<tr igitem='1'><td><table width='100%' cellpadding='1' cellspacing='0' id='igUltraWebMenu_3_3_2' igTag='FT'  igHov='igmnMenuItemHover' class="igmnMenuItem"> <tr><td width='25px' ></td><td igtxt='1'> <nobr>FTSDIS</nobr> </td><td width="15"></td></tr></table></td></tr>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 2:30 am 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
javascript: alert(document.all['igUltraWebMenu_3_3_2'].id)

Does get it to display the proper ID, but will still not let me click on it. This seems like its because it is hidden.

It is possible to use the keyboard to navigate the menu, once you have hoevered over one of the nodes, and the use {space} to select the item. Is it possible a submit command could work on hidden or non-visisble items?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 2:53 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
nobr is the tag
FTSDIS is the text

your clicks wont work unless you use the tag name

the item number is a 0 based index of the tag your using

note things like <nobr> are a tag and nobr is the tagname

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 3:45 am 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
document.all.tags[NOBR].item[1].click
...
document.all.tags[NOBR].item[100]click

Produces no result. Is there a way to pull the nobr index of an element?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 4:23 am 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
I've gone through all the functions, this section of the menu doesn't seem to be tied to anything that I can tell. I think I'm too burned out to continue today. I will stop back tomorrow.

If anyone out there is up to this crazy task, here is the full source from the page. The item I am trying to select is igUltraWebMenu_3_3_2.

The source breaks the code tags, you can download it here.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 5:32 am 
Tyrsius wrote:
The item I am trying to select is igUltraWebMenu_3_3_2
Are you sure? Based on MODIv2 it looks like that element is in the parent structure. Try perhaps:
Code:
javascript: document.all['igUltraWebMenu_3_3_2'].getElementsByTagName('nobr')[#].click()
Try different numbers for # - starting at 0. If that doesn't work, I would try using the childNode() method to step down from the igUltraWebMenu_3_3_2 element.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Bing [Bot], Google Feedfetcher, mrhobbeys, rbrtryn and 59 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group