Jump to content

How to Click on Javascript / Dojo TreeNode on Webpage


 Share

Recommended Posts

Hi Everyone, due to email system migration, I am trying to automate the email forwarding per account basis on webmail. The action required for each user is:

1. Logging in to webmail for the user

2. Click on the "Options" link

3. On the pop-up box, click on "Mail", then "Forwarding" (Screen shot provided)

4. Followed by keying in the forwarding details. 

I am stuck on step 3. It appears that the links for "Mail" and "Forwarding" are javascript and not real links. I do not have any programming and development experience and just started with AutoIT 2 weeks back just for this specific task. 

The source for the page is here, it looks like the part that i should be focusing on is : 

 

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Strict//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html>
<head>
  <meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'>
  <title>WebMail - Corporate Edition - Options</title>
  
  <link rel='stylesheet' type='text/css' href='/extras/dojo/dojo1.4.3/dojox/grid/resources/Grid.css'>
  <link rel='stylesheet' type='text/css' id='tundraGrid' href='/extras/dojo/dojo1.4.3/dojox/grid/resources/tundraGrid.css'>

  
  <meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'>
  <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
  <script type='text/javascript'> 
  try{ 
  document.execCommand('BackgroundImageCache', false, true); 
  }catch(e){} 
  </script>   
  
<link rel='stylesheet' type='text/css' href='/extras/dojo/dojo1.4.3/dojo/resources/dojo.css'>
<link rel='stylesheet' type='text/css' id='tundra' href='/extras/dojo/dojo1.4.3/dijit/themes/tundra/tundra.css'>
<style type='text/css'>
  html, body, pre, input,
  .dijitTextBox,
  .dijitComboBox,
  .dijitMenuItem,
  .dijitSpinner,
  .dojoxGrid,
  .dijitTextArea {
     font-family:  'Lucida Grande', Tahoma, Arial, Helvetica, sans-serif !important;
  }
  .miraLoadingImg { background: url('/extras/dojo/dojo1.4.3/dojox/image/resources/images/loading.gif'); }
  .tundra .miraToolbar { background:url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/titleBar.png') repeat-x top left !important; }
  .tundra .miraNoSortHeader:hover { background:url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/tabEnabled.png') repeat-x top left !important; } 
  .tundra .miraNoSortHeader {background:url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/tabEnabled.png') repeat-x top left !important; } 
  .tundra .dojoxGridHeader th {background:#E9E9E9 url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/tabEnabled.png') repeat-x top left !important; border-top:0px !important; }
  
  .soria .miraNoSortHeader:hover{ background:url('/extras/dojo/dojo1.4.3/dijit/themes/soria/images/titleBar.png') repeat-x top left; }
  .soria .miraToolbar { background:#eaeaea url('/extras/dojo/dojo1.4.3/dijit/themes/soria/images/titleBar.png') repeat-x top left; }

  .nihilo .miraNoSortHeader:hover{ background:url('/extras/dojo/dojo1.4.3/dijit/themes/nihilo/images/titleBar.png') repeat-x top left; }
  .nihilo .miraToolbar { background:#eaeaea url('/extras/dojo/dojo1.4.3/dijit/themes/nihilo/images/titleBar.png') repeat-x top left; }
  .nihilo .dojoxGridHeader .dojoxGridCell{background:#E9E9E9 url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/tabEnabled.png') repeat-x top left !important; }
  .nihilo .dijitTitlePaneTitle{background:#E9E9E9 url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/tabEnabled.png') repeat-x top left !important; }                   
  .nihilo .dijitToolbar{background:#E9E9E9 url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/tabEnabled.png') repeat-x top left !important; }
  .nihilo .dojoxGridHeader th{background:#E9E9E9 url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/tabEnabled.png') repeat-x top left !important;
    border-top:0px!important;   
     }
  .dojoxGridMasterHeader {background:#E9E9E9 url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/tabEnabled.png') repeat-x top left !important; }
  .dojoxGridHeader th{background:#E9E9E9 url('/extras/dojo/dojo1.4.3/dijit/themes/soria/images/titleBar.png') repeat-x top left !important;
    border-top:0px!important;   
     }
    
    
  .miraPlus { 
    background-image:url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/plusButton.gif'); 
    background-repeat: no-repeat;
    text-align: center;
    vertical-align: middle;
    width: 16px;
    height: 16px;
  }
  .miraMinus { 
    background-image:url('/extras/dojo/dojo1.4.3/dijit/themes/tundra/images/minusButton.gif'); 
    background-repeat: no-repeat;
    text-align: center;
    vertical-align: middle;
    width: 16px;
    height: 16px;
  }
  .miraClose { 
    background-image:url('/extras/dojo/dojo1.4.3/dojox/image/resources/images/close.png');
    background-repeat: no-repeat;
    text-align: center;
    vertical-align: middle;
    width: 16px;
    height: 16px;
  }
  p font {line-height: 120%;}
  h1 font {line-height: 120%;}
  h2 font {line-height: 120%;}
  h3 font {line-height: 120%;}
  h4 font {line-height: 120%;}
  h5 font {line-height: 120%;}
  h6 font {line-height: 120%;}
</style>

 
<script type='text/javascript' src='/extras/dojo/dojo1.4.3/dojo/aggregate_dojo.js' 
        djConfig='isDebug: false, debugAtAllCosts: false,  parseOnLoad: true, usePlainJson: true, 
        baseUrl: "/extras/dojo/dojo1.4.3/dojo/", 
        locale:"en-us", extraLocale: ["en-us"]'></script> 

<script type='text/javascript' src='/extras/dojo/dojo1.4.3/dojo/ce.js'></script>

  
<style type='text/css'>
.gen_silk_icon {
  background-image: url(/wm/eml/icons/silk_imagemap.png?locale=en_US.ISO_8859-1&ui_ver=4.3.7-GA.5&brand=system&deldom=);
  background-repeat: no-repeat;
  width: 16px;
  height: 16px;
  text-align: center;
  vertical-align: middle;
}

.miraLogo {
  background-image: url(/wm/eml/icons/lhs_banner_logo.gif?locale=en_US.ISO_8859-1&ui_ver=4.3.7-GA.5&brand=system&deldom=);
  background-repeat: no-repeat;
  background-position: center center;
  width: 100%;
  height: 100%;
}

.handle {
  background-image: url(/wm/eml/icons/handle.png?locale=en_US.ISO_8859-1&ui_ver=4.3.7-GA.5&brand=system&deldom=);
  background-repeat: repeat-y;
  background-position: 0px 0px;
}

.genInfoSplitter {
  background-image: url(/wm/eml/icons/info_card_splitter.gif?locale=en_US.ISO_8859-1&ui_ver=4.3.7-GA.5&brand=system&deldom=);
  background-repeat: repeat-x;
  background-position: bottom;
  background-color: transparent;
  height: 4px;
  width: 100%;
  margin: 0px;
  padding: 0px;
}

.mcalFreeBusyGridInvalidRow {
  background-image: url(/wm/eml/icons/calendar_freebusy_invalid.gif?locale=en_US.ISO_8859-1&ui_ver=4.3.7-GA.5&brand=system&deldom=);
  position: absolute;
  border-width: 1px 1px 1px 1px;
  border-style: solid;
  border-color: #dddddd;
  z-index: 3;
  height: 19px;
}
</style>

  <link rel='stylesheet' type='text/css' id='system-default' href='/wm/eml/extras/css/aggregated_css/uui_system-default.css?ui_ver=4.3.7-GA.5&locale=en_US.ISO_8859-1&brand=system&deldom='>
  
  <link rel='SHORTCUT ICON' href='/wm/eml/icons/mirapoint.ico?locale=en_US.ISO_8859-1&ui_ver=4.3.7-GA.5&brand=system&deldom='>
  <script type='text/javascript' src='/wm/eml/eui.js?ui_ver=4.3.7-GA.5&locale=en_US.ISO_8859-1&brand=system&deldom='></script>
  
<script type='text/javascript'>
<!-- 
if (typeof __mainWindow__ != 'undefined' && __mainWindow__.__debug__) __include__('/wm/eml/debug.js'); 
//-->
</script>


<script type='text/javascript'>
<!--
    // dojo widgets, handles, etc.
    var model = null, tree = null, 
    stores = {},
    connects = [],
    lhs_item = null,
    anyone_perm_item = null,
    opt_change_ui_cb = dojo.hitch(eUI, 'opt_change_ui'),
    options_items = [];

    
options_items.push({
    'id'        : 'general',
    'label'     : localevar.get('General'),
    'url'       : null,
    'toplevel'  : true,
    'noselect'  : true
});

    

options_items.push({
    'id'    :   'popt_personal',
    'label' :   localevar.get('Account'),
    'url'   :   '/wm/eml/popt_personal.html',
    'pName' :   'general'
});


options_items.push({
    'id'    :   'changepass',
    'label' :   localevar.get('Change Password'), 
    'url'   :   '/cgi-bin/euadmin.cgi/eup/changepass.html',
    'pName' :   'general'
});


options_items.push({
    'id'    :   'popt_colortheme',
    'label' :   localevar.get('Color Theme'), 
    'url'   :   '/wm/eml/popt_colortheme.html',
    'pName' :   'general'
});


options_items.push({
    'id'    :   'popt_aboutpage',
    'label' :   localevar.get('About'), 
    'url'   :   '/wm/eml/popt_aboutpage.html',
    'pName' :   'general'
});


    
options_items.push({
    'id'        : 'mail',
    'label'     : localevar.get('Mail'),
    'url'       : null,
    'toplevel'  : true,
    'noselect'  : true
});

    

options_items.push({
    'id'    :   'mopt_general',
    'label' :   localevar.get('Settings'), 
    'url'   :   '/wm/eml/mopt_general.html',
    'pName' :   'mail'
});


options_items.push({
    'id'    :   'mopt_composing',
    'label' :   localevar.get('Composing'), 
    'url'   :   '/wm/eml/mopt_composing.html',
    'pName' :   'mail'
});


options_items.push({
    'id'        :   'autoreply',
    'label'     :   localevar.get('Auto-Reply'), 
    'url'       :   '/cgi-bin/euadmin.cgi/eup/autoreply.html',
    'pName'     :   'mail'
});


options_items.push({
    'id'    :   'forward',
    'label' :   localevar.get('Forwarding'), 
    'url'   :   '/cgi-bin/euadmin.cgi/eup/forward.html',
    'pName' :   'mail'
});


options_items.push({
    'id'    :   'mopt_signature',
    'label' :   localevar.get('Signature'), 
    'url'   :   '/wm/eml/mopt_signature.html',
    'pName' :   'mail'
});


options_items.push({
    'id'    :   'getmail',
    'label' :   localevar.get('External Mail'), 
    'url'   :   '/cgi-bin/euadmin.cgi/eup/getmail.html',
    'pName' :   'mail'
});


options_items.push({
    'id'    :   'whitelist',
    'label' :   localevar.get('Allowed Senders'), 
    'url'   :   '/wm/eml/mopt_uce.html?ucetype=wl',
    'pName' :   'mail'
});


options_items.push({
    'id'    :   'blacklist',
    'label' :   localevar.get('Blocked Senders'), 
    'url'   :   '/wm/eml/mopt_uce.html?ucetype=bl',
    'pName' :   'mail'
});


options_items.push({
    'id'    :   'whitelistto',
    'label' :   localevar.get('Allowed Mailing Lists'), 
    'url'   :   '/wm/eml/mopt_uce.html?ucetype=recipwl',
    'pName' :   'mail'
});


options_items.push({
    'id'    :   'contfilt_adv',
    'label' :   localevar.get('Message Filters'), 
    'url'   :   '/cgi-bin/euadmin.cgi/eup/contfilt_adv.html',
    'pName' :   'mail'
});


    
options_items.push({
    'id'    :   'calendar',
    'label' :   localevar.get('Calendar'),
    'url'   :   null,
    'toplevel'  :   true,
    'service'   :   'calendar',
    'noselect'  :   true
});

    

options_items.push({
    'id'    :   'prefs_gen',
    'label' :   localevar.get('Presentation'), 
    'url'   :   '/mc/ecal/prefs_gen.html',
    'pName' :   'calendar'
});


options_items.push({
    'id'    :   'reminders',
    'label' :   localevar.get('Reminders'), 
    'url'   :   '/mc/ecal/reminders.html',
    'pName' :   'calendar'
});


options_items.push({
    'id'        :   'permissions',
    'label'     :   localevar.get('Sharing Controls'), 
    'url'       :   '/mc/ecal/permissions.html',
    'service'   :   'group_calendar',
    'pName'     :   'calendar'
});


options_items.push({
    'id'        :   'prefs_publish',
    'label'     :   localevar.get('Publish'), 
    'url'       :   '/mc/ecal/prefs_publish.html',
    'service'   :   'group_calendar',
    'pName'     :   'calendar'
});


    


options_items.push({
    'id'    :   'downloads',
    'label' :   localevar.get('Downloads'),
    'url'   :   null,
    'noselect'  :   true,
    'toplevel'  :   true
});

options_items.push({
    'id'    :   'download_ConnectR',
    'label' :   localevar.get('ConnectR for Outlook'), 
    'url'   :   '/mc/ecal/download_ConnectR.html',
    'pName' :   'downloads'
});





    dojo.addOnLoad(function(){
        stores.lhs = new dojo.data.ItemFileWriteStore({  data: { identifier:   'id',
                                 label:        'label',
                                 items:        eUI.prepareTree(options_items)
                              }
                              });
                            

        model = new dijit.tree.ForestStoreModel({
                                        store: stores.lhs,
                                        query: {toplevel:true},
                                        rootId: "options_root",
                                        childrenAttrs: ["children"]
                                });

        tree = new mira.Tree({
                                    model:      model,
                                    showRoot:   false,
                                    persist:    true,
                    id:         "options_tree"
                                   },
                                   document.getElementById("options_tree_here"));

        tree.startup();

    if (__mainWindow__.prefsMgr.haveService('group_calendar')) {
        stores.permissions = new mira.DataStore({
                            data:   {   identifier:'id',
                    label:'label',
                    items: []}
                    });
    }

        connects.push(dojo.connect(tree, "onClick", eUI, eUI.options_click));    

    eUI.popupLoaded();
    __mainWindow__.prefsMgr.go(eUI, options_items[1]);
    });

//-->
</script>
</head>
<body class="miraPopup tundra" onunload='eUI.eup_unload();'>
<div class="miraPreloader miraLoadingImg" id="mira_preloader"></div>
<div id ="mira_standby" target="opt_rhs" dojoType="dojox.widget.Standby" color="#eeeeee" zIndex="12000"></div>
<div dojoType="dijit.layout.BorderContainer" design="sidebar" style="height:100%;width:100%; overflow:hidden;" gutters="true">
    <div dojoType="dijit.layout.ContentPane" region="left" style="width:225px;" splitter="true">
    <div class="genTitle" style="width:100%;">Options</div>
    <div id="options_tree_here"></div>
    </div>
    <div dojoType="dijit.layout.ContentPane" id="opt_rhs" region="center" style="" onLoad="eUI.options_rhs_loaded();">
    </div>
</div>
</body>
</html>

It seems like the part i should be focusing on is here:

options_items.push({
    'id'    :   'forward',
    'label' :   localevar.get('Forwarding'), 
    'url'   :   '/cgi-bin/euadmin.cgi/eup/forward.html',
    'pName' :   'mail'
});

After searching the forum and reading the help file, I have attempted at least the following: 

1. _IENavigate - fail as the URL is special for each logged in session

2. _IELinkClickByText - failed as no link is found ( i used _IELinkGetCollection = 0 link found)

3. IETableGetCollection - only found 2 tables and its only for the right hand pane of the page. 

4. IEPropertyGet 'innertext' - no errors, but no clicking actions

5. _IETagNameAllGetCollection - Found Tagname: DIV, ID: dijit__TreeNode_10, innertext: * Forwarding but not able to use these information to get autoit to click.

6. _IEImgGetCollection - Found 41 instances of *blank.gif, tried to randomly click an index of gif, but no visible actions being done. 

 

My code is here, it is heavily commented out by the past attempts, so it must be hard to read, apologies in advance. The trouble begins at line 82. Any help or advice is greatly appreciated.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.2
 Author:         Danny

 Script Function:
    Automate Mirapoint Forwarding PER user basis. THis needs to run for each
    user that is migrating

#ce ----------------------------------------------------------------------------
#include <IE.au3>
#include <MsgBoxConstants.au3>
;~ #include <Array.au3>

Global $i = 0

If $i = 7 Then
   MsgBox(0, "Rerun", "Lets try that again. Ensure that values are correctly entered")
EndIf

;~ MsgBox(0, "Notice", "System will now help you to forward your mails. Please key in your account information and do not interrupt the process")
;Get Email Address from user
Global $EmailAddr = "username@olddomain.com"

; Asks the user to enter a password.
Global $Password = "passwordentered"

;Get Forwarding Address from user
Global $FwdAddr = "FIRST.LASTname@newdomain.com"

; Display a progress bar window.
    ProgressOn("Progress Meter", "DO NOT INTERRUPT PROCESS", "0%", @DesktopWidth - 310, 0)

; Update the progress value of the progress bar window
    ProgressSet("25%", "25%")



; Open Webmail using IE
Global $oIE = _IECreate("http://webmail.sg.yusen-logistics.com")

_IELoadWait($oIE)

;click on Continue
_IELinkClickByText($oIE, "Continue to this website (not recommended).")

;fill in the user and password and click login button
Global $FormUser = _IEGetObjByName($oIE, "user")
Global $FormPassword = _IEGetObjByName($oIE, "password")
Global $Formlogin = _IEGetObjByName($oIE, "login")
_IEFormElementSetValue($FormUser, $EmailAddr)
_IEFormElementSetValue($FormPassword, $Password)
_IEAction($Formlogin, "click")
_IELoadWait($oIE)

; Update the progress value of the progress bar window
    ProgressSet("50%", "50%")

;#### Click on the "Options" link found on the first frame on top of the website ( 0 )
$oFrame = _IEFrameGetCollection ($oIE)
Local $iNumFrames = @extended
;~ Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
;~ Local $oFrame = 0
;~ For $i = 0 To ($iNumFrames - 1)
;~     $oFrame = _IEFrameGetCollection($oIE, $i)
;~     $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF
;~ Next
;~ MsgBox($MB_SYSTEMMODAL, "Frames Info", $sTxt)
Sleep(3000)
_IELinkClickByText($oFrame, "Options");click Options link from frame object from its text
_IELoadWait($oIE)



;attach script to new pop up window
$oIE = _IEAttach("https://webmail.sg.yusen-logistics.com/cgi-bin/euadmin.cgi/eup/", "url")
Sleep(6000)


; Update the progress value of the progress bar window
    ProgressSet("65%", "65%")

;### Try using IEFormGetCollection = 1 form, invalid object type
;~ Local $oForms = _IEFormElementGetCollection($oIE)
;~ Local $iNumForms = @extended
;~ MsgBox($MB_SYSTEMMODAL, "Forms Info", "There are " & $iNumForms & " forms on this page")
;~ Local $oForm
;~ For $i = 0 To $iNumForms - 1
;~     $oForm = _IEFormGetCollection($oIE, $i)
;~     MsgBox($MB_SYSTEMMODAL, "Form Info", $oForm.name)
;~ Next






;### Try using IEImgGetCollection = 41 blank.gifs found
;~ Local $oImgs = _IEImgGetCollection($oIE)
;~ Local $iNumImg = @extended

;~ Local $sTxt = "There are " & $iNumImg & " images on the page" & @CRLF & @CRLF
;~ For $oImg In $oImgs
;~    $sTxt &= $oImg.src & @CRLF



;~ Next
;~ MsgBox($MB_SYSTEMMODAL, "Img Info", $sTxt)
;~ _IEImgClick($oIE, "https://webmail.sg.yusen-logistics.com/extras/dojo/dojo1.4.3/dojo/resources/blank.gif", "src", 10)



;#### Try using TagNameGetCollection using DIV
;~ Local $oTags_coll = _IETagNameGetCollection($oIE, "DIV")
;~    For $oTag_enum in $oTags_coll
;~    if $oTag_enum.innertext = "Forwarding" then
;~       MsgBox($MB_SYSTEMMODAL, "ID", "ID :" & $oTag_enum.id)


;~            _IEAction($oTag_enum, "click")

;~            ExitLoop

;~        EndIf
;~    Next

;~ ;#### Try using IETableGetCollection = 2 tables, only shows the right hand pane
;~ Local $oTable = _IETableGetCollection($oIE)
;~ Local $iNumTables = @extended
;~ MsgBox($MB_SYSTEMMODAL, "Table Info", "There are " & $iNumTables & " tables on the page")
;~ Local $oTable = _IETableGetCollection($oIE, 1)
;~ Local $aTableData = _IETableWriteToArray($oTable)
;~ _ArrayDisplay($aTableData)


;#### Try using IEPropertyGet then action click
;~ If _IEPropertyGet($oIE, "innertext") Then
;~     MsgBox($MB_SYSTEMMODAL, "Status", "Forwarding link found")
;~   If String(_IEPropertyGet($oIE, "innertext")) = "* Forwarding" Then
;~    _IEAction($oIE, "focus")
;~       _IEAction($oIE, "click")
;~ Else
;~     MsgBox($MB_SYSTEMMODAL, "Status", "Forwarding link not found")

;~ EndIf


;#### Send manual keyboard commands

;~ Send("{TAB 3}")
;~ Send("{DOWN 9}")
;~ Send("{ENTER}")

;#### Get all frames = 0 Frames found
;~ Local $oFrames = _IEFrameGetCollection($oIE)
;~ Local $iNumFrames = @extended
;~ Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
;~ Local $oFrame = 0
;~ For $i = 0 To ($iNumFrames - 1)
;~     $oFrame = _IEFrameGetCollection($oIE, $i)
;~     $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF
;~ Next
;~ MsgBox($MB_SYSTEMMODAL, "Frames Info", $sTxt)

;#### Get all tags and IDs in page. Found ID = dijit_TreeNode_10, innertext: *Forwarding)
;~ Local $oElements = _IETagNameAllGetCollection($oIE)
;~ For $oElement In $oElements
;~     If $oElement.id Then MsgBox($MB_SYSTEMMODAL, "Element Info", "Tagname: " & $oElement.tagname & @CRLF & "id: " & $oElement.id & @CRLF & "innerText: " & $oElement.innerText)
;~ Next

;#### Click by ID = dijit__TreeNode_10 (double underscore)
;~ Local $oForward = _IEGetObjById($oIE, 'forward')
;~ MsgBox($MB_SYSTEMMODAL, "Status", @error)
;~ _IEAction($oForward, "focus");
;~ _IEAction($oForward, "click");
; Get coordinates and dimensions of the dijit__TreeNode_10
;~ Local $iScreenX = _IEPropertyGet($oForward, "screenx")
;~ Local $iScreenY = _IEPropertyGet($oForward, "screeny")
;~ Local $iBrowserX = _IEPropertyGet($oForward, "browserx")
;~ Local $iBrowserY = _IEPropertyGet($oForward, "browserY")
;~ Local $iWidth = _IEPropertyGet($oForward, "width")
;~ Local $iHeight = _IEPropertyGet($oForward, "height")
;~ Local $iMousespeed = 50
;~ MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed)



;#### Click by text = *Forwarding and * Forwarding (with space)
;~ _IELinkClickByText($oIE, "*Forwarding")

;#### Get all links in page = 0 links found
;~ $oLinks = _IELinkGetCollection($oIE)
;~ Local $iNumLinks = @extended

;~ Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF
;~ For $oLink In $oLinks
;~     $sTxt &= $oLink.href & @CRLF
;~ Next
;~ MsgBox($MB_SYSTEMMODAL, "Link Info", $sTxt)

;#### Click by objectname = forward, * Forward, *Forward
;~ Local $oForward = _IEGetObjByName($oIE, "*Forward")
;~ _IEAction($oForward, "click");click Forward link from frame object from its text

;#### Using IENavigate to the url
;~ _IENavigate($oIE, "https://webmail.sg.yusen-logistics.com/wm/mail/cgi-bin/euadmin.cgi/eup/forward.html")

#cs------------------
;click on Yes radio button and key in forwarding email address
Sleep(1000)
Send("{TAB 4}")
Send("{SPACE}")
Send("{TAB}")
Send($FwdAddr)
Send("+{TAB 3}")
Send("{SPACE}")
Sleep(1500)
Send("{TAB 2}")
Send("{ENTER}")
#ce------------------
;~ ;Click on the "Apply Button"
;~ $oFrame = _IEFrameGetCollection ($oIE, 1)
;~ _IEImgClick($oFrame, "Apply", "alt")
;~ Sleep(2000)
;~ ;Click on Close
;~ ;_IEImgClick($oFrame, "Close", "alt")
;~ _IEQuit($oIE)
$oIE = _IEAttach("WebMail - Corporate Edition")
;~ _IEQuit($oIE)

 

Options_Page.png

Link to comment
Share on other sites

; example of tag and innerhtml <span class="buttonText">start</span>
    $spans = $ie.document.getElementsByTagName('span')
    for $s in $spans
    If $s.innerHTML = "start" Then
        $s.click()
    EndIf
    Next

if to right click view sourcecode on the page find the tag and the innerHTML this will work

i use w3schools for this as they give you examples

Link to comment
Share on other sites

How many "!DOCTYPE" tag you see in your HTML source in your webpage ?

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

  • 4 weeks later...
On 1/4/2016 at 2:41 AM, bikerbrooks said:
; example of tag and innerhtml <span class="buttonText">start</span>
    $spans = $ie.document.getElementsByTagName('span')
    for $s in $spans
    If $s.innerHTML = "start" Then
        $s.click()
    EndIf
    Next

if to right click view sourcecode on the page find the tag and the innerHTML this will work

i use w3schools for this as they give you examples

hi bikerbrooks, based on the View Source page, i am not able to get any clues on which Tag. 

options_items.push({
    'id'    :   'forward',
    'label' :   localevar.get('Forwarding'), 
    'url'   :   '/cgi-bin/euadmin.cgi/eup/forward.html',
    'pName' :   'mail'
});

 

Link to comment
Share on other sites

On 4.01.2016 at 9:11 AM, dnnytn said:

3a. On the pop-up box,  (???? What a PopUp ??? )
3b. click on "Mail",
3c. then "Forwarding"

......

I am stuck on step 3.  Please be more precisely: What you mean: 3a ? 3b ? 3c ?

btw.
Inpsect "Mail" and give here Outer HTML snippet for this part of "Tree" .

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

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

×
×
  • Create New...