Sign in to follow this  
Followers 0

How to navigate to a page with a changing link?

11 posts in this topic

Posted

Hi,

I have a small script that takes the user to a specific internet page. Here is an extract:

#include <IE.au3>

$oIE = _IECreate ("ts.company.com/Citrix/XenApp/auth/login.aspx")

Sleep (2000)

WinWaitActive ("Citrix XenApp - Applications")

sleep (500)

_IENavigate ($oIE, "https://ts.company.com/Citrix/XenApp/site/default.aspx?CTX_CurrentTab=Desktops"); link 1

sleep (1000)

_IENavigate ($oIE, "https://ts.company.com/Citrix/XenApp/site/default.aspx?CTX_CurrentFolder=%5cHyperion"); link 2

sleep (1000)

_IENavigate ($oIE, "https://https://ts.company.com/Citrix/XenApp/site/launcher.aspx?CTX_Application=Citrix.MPS.Desktop.GLOBAL.Hyperion%20309&CTX_Token=1646B315682B558D8EB05129561B3434&LaunchId=1251290247044"); link 3

All works well till the last part of the third navigation. The problem is that this part "1646B315682B558D8EB05129561B3434&LaunchId=1251290247044" in _IENavigate link 3 is changing to another values, every time the the user is logging in, so the full link is different.

Is there any way, that I could ignore that part or use another method to click this link on the screen?

Sorry if a similar questions was already posted.

Share this post


Link to post
Share on other sites



Posted

You should click on the link or on the button by using the _IE functions like _IEAction("click") or _IELinkClickByText or some other depending on the current site setup.

Share this post


Link to post
Share on other sites

Posted

Thanks for the tip.

I have tried both _IE functions:

1) I've removed Link 3 and added this:

$oHyp = _IEGetObjByName ($oIE, "Hyperion 309")

_IEAction ($oHyp, "click")

2) I've removed Link 3 and added this:

_IELinkClickByText ($oIE, "Hyperion 309")

However, both commands didn't take me to the link needed...

Share this post


Link to post
Share on other sites

Posted

It very much depends on the exact setup of the page as i said.

Post the source code here so i can point you to the right direction.

Share this post


Link to post
Share on other sites

Posted

Here is the source code of the page that I'm stuck with.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="ROBOTS" content="NOINDEX, NOFOLLOW, NOARCHIVE">
  <meta http-equiv="X-UA-Compatible" content="IE=7">
  <title>Citrix XenApp - Applications</title>
  <link rel="SHORTCUT ICON" href="../media/IcaComboAll.ico" type="image/vnd.microsoft.icon">
  <link rel="stylesheet" type="text/css"  media="handheld,all" href="style.aspx?cacheString=en++Normal++dXXMHnhwaU337bfclTlGIC++fq6kupNHGo9Oyl2mpZbz8C" >
  <script type="text/javascript" src="javascript.aspx?cacheString=en++Normal++dXXMHnhwaU337bfclTlGIC++fq6kupNHGo9Oyl2mpZbz8C++authenticated"></script>
  <script type="text/javascript">
    <!--
    // Ensure every page has an onloadLayout function. If a page defines its own
    // onloadLayout function, it will override this one.
    function onloadLayout() {
      return;
    }
    function getFrameSuffix() {
      return "WI_b5Aop2rUy9ZhNTqay";
    }
    function getSessionToken() {
      return "DCE18B9D3F987A17A84C2AAE9B1AB470";
    }
    // -->
  </script>
  <script type="text/javascript">
      <!--
      
      function doAutoLaunching() {
        
        
      }
      // fullApplist.js
// Copyright (c) 2001 - 2009 Citrix Systems, Inc. All Rights Reserved.
// Web Interface 5.1.1.0
 
function onloadLayout()
{
    maintainAccessibility("SearchButton", true);
    setupTreeView();
    setupSearchBox();
}
 
 
var treeViewCurrentFolder = "";
 
 
function changeView(dropdown)
{
    var newpage = "default.aspx?CTX_CurrentViewStyle="
        + dropdown.options[dropdown.selectedIndex].value;
    if(isTreeView()) {
        newpage += "&CTX_CurrentFolder=" + encodeURIComponent(getTreeViewCurrentFolder());
        
        setItemInCookie("treeViewCurrentFolder", null);
    }
    location.href = newpage;
}
 
 
function setupTreeView()
{
    if (isTreeView()) {
        
        retrieveImage(document.getElementById('treeView'));
        expandTreeViewInitialFolder();
    }
}
 
 
function toggleTreeNode(node)
{
    var nodeClass = node.className;
    if(nodeClass == "folderClose"){
        openFolder(node);
        setTreeViewCurrentFolder(node, false);
    } else {
        closeFolder(node);
        setTreeViewCurrentFolder(node, true);
    }
    updateLayout(); 
}
 
 
function openFolder(node) {
    node.className = "folderOpen";
    node.nextSibling.style.display='block';
    retrieveImage(node.nextSibling);
    changeSrcOfChildImgNodes(node, "../media/FolderOpenArrowDown.gif");
}
 
 
function closeFolder(node) {
    node.className = "folderClose";
    node.nextSibling.style.display='none';
    changeSrcOfChildImgNodes(node, "../media/FolderClosedArrow.gif");
}
 
 
function updateMouseoverTreeNodePicture(node) {
    var nodeClass = node.className;
    if(nodeClass == "folderClose"){
        changeSrcOfChildImgNodes(node, "../media/FolderClosedArrowHover.gif");
    } else {
        changeSrcOfChildImgNodes(node, "../media/FolderOpenArrowDownHover.gif");
    }
}
 
 
function updateMouseoutTreeNodePicture(node) {
    var nodeClass = node.className;
    if(nodeClass == "folderClose"){
        changeSrcOfChildImgNodes(node, "../media/FolderClosedArrow.gif");
    } else {
        changeSrcOfChildImgNodes(node, "../media/FolderOpenArrowDown.gif");
    }
}
 
 
function changeSrcOfChildImgNodes(node, url) {
    for (var j = 0; j < node.childNodes.length; j++) {
          var child = node.childNodes[j];
          // if it is an image tag, put the closed image in
          if (child.nodeName == "IMG") {
              child.src = url;
              break;
          }
     }
}
 
 
function redirectToSearchResults() {
    var searchTextbox = document.getElementById('searchEntry');
    var searchText;
    if(searchTextbox.hasFocus)
    {
        searchText = searchTextbox.value;
    } else {
        searchText = currentSearchQuery;
    }
    window.location.href = "default.aspx?CTX_SearchString=" + encodeURIComponent(searchText);
}
 
 
 
function retrieveImage(selectedFolder)
{
    for (var i = 0; i <selectedFolder.childNodes.length; i++) {
         var item = selectedFolder.childNodes[i];
         if (item.nodeName == "LI") { //found a list item here
             for (var j = 0; j <item.childNodes.length; j++) {
                 var hrefItem = item.childNodes[j];
                 // if it is an a tag, but not a folder tag, then
                 // load the image appropriatly
                 if (hrefItem.nodeName == "A" && hrefItem.className.indexOf("folder") == -1 && hrefItem.childNodes.length > 0) {
                     for (var k = 0; k <hrefItem.childNodes.length; k++) {
                          if (hrefItem.childNodes.item(k).nodeName == "IMG") { // got the img tag to change
                              if (hrefItem.childNodes.item(k).name != null) {
                                  hrefItem.childNodes.item(k).src = hrefItem.childNodes.item(k).name;
                                  break;
                              }
                          }
                     }//for loop with k
                 }
             } //outer for loop
         }
    }
}
 
 
function expandTreeViewInitialFolder()
{
    var currentFolderValue = getTreeViewCurrentFolder();
    var rootNode  =document.getElementById("treeView");
    if ((currentFolderValue != null) && (currentFolderValue != "")) {
        expandTreeView(rootNode, currentFolderValue);
    }
}
 
 
function expandTreeView(ulElement, path)
{
    if (path.indexOf("\\") == 0) { // remove the fist occurance of . from the path
        path = path.substring(1);
    }
 
    var value;
    if (path.indexOf("\\") > 0){ // gets the folder name
        value = path.substring(0, path.indexOf("\\"));
    } else {
        value = path;
    }
 
    for (var i = 0; i <ulElement.childNodes.length; i++) {
        var item = ulElement.childNodes[i];
        for (var j = 0; j <item.childNodes.length; j++) {
             if (item.nodeName == "LI") { // found a list item here
                 var liChildNode = item.childNodes[j];
                 // If the list item is followed by an <a> tag and a <ul> tag
                 // then we know that the first child of the list item is the folder name.
                 if (liChildNode.nodeName == "A" && (liChildNode.nextSibling != null && liChildNode.nextSibling.nodeName == "UL")) {
                     // Check if the folder name matches
                     if (findFolderName(liChildNode) == value) {
                         openFolder(liChildNode);
                         path = path.substring(path.indexOf("\\"));
                         expandTreeView(liChildNode.nextSibling, path);
                     }
                 }
             }
        }
    }
}
 
function setTreeViewCurrentFolder(node, isCollapsed)
{
      var currentFolder = findFolderName(node);
      var currentNode = node.parentNode.parentNode.parentNode;
      while(currentNode.nodeName == "LI" ) {
         for (var j = 0; j <currentNode.childNodes.length; j++) {
              var liChildNode = currentNode.childNodes[j];
              // If the list item is followed by an <a> tag and a <ul> tag
              // then we know that the first child of the list item is the folder name.
              if (liChildNode.nodeName == "A" && (liChildNode.nextSibling != null &&  liChildNode.nextSibling.nodeName == "UL")) {
                  currentFolder = findFolderName(liChildNode)+"\\"+currentFolder;
              }
         }
         currentNode = currentNode.parentNode.parentNode;
      }
      if (currentFolder != "" && isCollapsed) {
          
          var index = currentFolder.lastIndexOf("\\");
          if(index==-1)
          {
            currentFolder = "\\";
          }
          else
          {
            currentFolder = currentFolder.substring(0, index);
          }
      }
      setItemInCookie("treeViewCurrentFolder", currentFolder);
}
 
 
function findFolderName(node) {
    var currentFolder = null;
    for (var j = 0; j < node.childNodes.length; j++) {
      var child = node.childNodes[j];
      // if it a text node (i.e. not the image node)
      // it should be the name of the folder
      if (child.nodeType == 3) {
          currentFolder = child.nodeValue;
          break;
      }
    }
    return currentFolder;
}
 
 
function isTreeView()
{
    return document.getElementById('treeView') != null;
}
 
 
var currentSearchQuery = "";
 
 
function isSearchTabSelected()
{
    return "True"=="False";
}
 
 
function setupSearchBox()
{
    var searchTextbox = document.getElementById('searchEntry');
    if (searchTextbox) {
        if(isSearchTabSelected())
        {
            searchTextbox.value = currentSearchQuery;
            searchTextbox.select();
        }
    }
}
 
 
function searchTextFocus(searchTextbox) {
    searchTextbox.hasFocus = true;
    searchTextbox.value = currentSearchQuery;
    searchTextbox.select();
    changeSearchBtnImage(true);
}
 
 
function changeSearchBtnImage(isMouseOver){
    var buttonId = document.getElementById("graphic_SearchButton");
    if (buttonId != null) {
        var upBg = "#3E3E3E url(../media/SearchGradient.gif) repeat-x top left";
        var overBg = "#5397D5 url(../media/SearchGradientHover.gif) repeat-x top left";
        
        buttonId.style.background = isMouseOver ? overBg : upBg;
    }
}
 
 
function changeCloseImage(currentNode, isMouseHover) {
    for (var j = 0; j <currentNode.childNodes.length; j++) {
        var imgChildNode = currentNode.childNodes[j];
        if (imgChildNode.nodeName == "IMG") {
            if (isMouseHover) {
               imgChildNode.origSrc = imgChildNode.src;
               imgChildNode.src="../media/ActiveClose.gif";
            } else {
               imgChildNode.src= imgChildNode.origSrc;
            }
        }
    }
}
 
 
function showCloseImage(showImage) {
 
   var closeImageId  = document.getElementById("closeImage");
   if (showImage) {
       closeImageId.style.visibility ='visible';
   } else {
       closeImageId.style.visibility ='hidden';
   }
 
}
 
 
function getTreeViewCurrentFolder() {
   
    var currentFolderValue = getItemFromCookie("treeViewCurrentFolder");
    if (currentFolderValue == null || currentFolderValue == "") {
        currentFolderValue = "";
    }
    return currentFolderValue;
}
 
 
// cookies.js
// Copyright (c) 2003 - 2009 Citrix Systems, Inc. All Rights Reserved.
// Web Interface 5.1.1.0
 
 
function setItemInCookie(name, value) {
    if (value == null) {
        value = "";
    }
    if ((name == null) || (name == "")) {
        return;
    }
 
    var newCookie = "";
    var oldCookie = getCookie("WIClientInfo");
    if (oldCookie != "") {
        var cookieItems = oldCookie.split("~");
        for (i=0; i < cookieItems.length; i++) {
            // The name of the item will be escaped so we need to make sure
            // that we search for the escaped version.
            if (cookieItems[i].indexOf(escape(name) + "#") != 0) {
                newCookie += cookieItems[i] + "~";
            }
        }
    }
 
    newCookie += escape(name) + "#" + escape(value);
    storeCookie("WIClientInfo", newCookie);
}
 
 
function getItemFromCookie(name) {
    return unescape(getValueFromString(escape(name), getCookie("WIClientInfo"), "#", "~"));
}
 
 
function storeCookie(name, value) {
    if (value) { // non-null, non-empty
        value = "\"" + value + "\"";
    } else {
        value = "";
    }
 
    if (window.location.protocol.toLowerCase() == "https:") {
        value += "; secure";
    }
 
    var cookie = name + "=" + value;
 
    cookie = cookie + "; path=/Citrix/XenApp/site/";
 
    document.cookie = cookie;
}
 
 
function getCookie(name) {
    var cookie = getValueFromString(name, document.cookie, "=", ";");
    if ( (cookie.charAt(0) == "\"") && (cookie.charAt(cookie.length-1) == "\"") ) {
        cookie = cookie.substring(1, cookie.length-1);
    }
    return cookie;
}
 
function getValueFromString(name, str, sep1, sep2) {
    var result = "";
 
    if (str != null) {
        var itemStart = str.indexOf(name + sep1);
        if (itemStart != -1) {
            var valueStart = itemStart + name.length + 1;
            var valueEnd = str.indexOf(sep2, valueStart);
            if (valueEnd == -1) {
                valueEnd = str.length;
            }
            result = str.substring(valueStart, valueEnd);
        }
    }
 
    return result;
}
 
      // -->
  </script>
 
  
</head>
 
 
 
<body onload="resetSessionTimeout();doAutoLaunching();onloadLayout();setup_popup_behaviour();updateLayout();configureLightbox();" dir="ltr">
 
 
  <div id="overallWrapper">
    <div id="leftShadow"> 
      <div id="rightShadow"> 
  <div id="content">
    
<div id="header">
<img src="../media/CitrixLogoHeader.gif" alt="Heading image" />
 
</div>
 
    
<div class="navBarDiv">
  <ul class="navBar">
 
    <li id="navAppList" class='currentLink'>
      <a id="navAppListLink" href="default.aspx" tabIndex='1'
         >Applications</a>
    </li>
 
    <li id="navMessages" class=' messageSummary'>
 
 
<a id="navMessagesLink" href="messageScreen.aspx" tabIndex='1'><span class="">Messages</span></a>
 
    </li>
 
    <li id="navSettings" class=''>
      <a id="navSettingsAnchor" class='dropDownMenu' href="preferences.aspx" tabIndex='1'
      >Preferences<img id="menuImg" src="../media/DropDownArrow.png" alt="" style="padding:0px 0px 0px 5px" /></a>
    </li>
 
    <li id="navEtchFiller">&nbsp;</li>
 
  </ul>
  <div class="spacer"></div>
</div>
 
  <div id='Popup_navMessages' class="wiPopup" >
    
      <p>You have no messages</p>
    
  </div>
 
<div class="wiPopup settingsSubMenu" id='Popup_navSettingsAnchor'
>
 
    <a id="navPopupDisplaySettingsLink" href="displaySettings.aspx" tabIndex='1'
       >Display Settings</a>
 
    <a id="navPopupSessionSettingsLink" href="sessionSettings.aspx" tabIndex='1'
       >Session Settings</a>
 
  <a id="navPopupAccountSettingsLink" href="accountSettings.aspx" tabIndex='1'
     >Account Settings</a>
 
  <a id="navPopupConnectionSettingsLink" href="connectionSettings.aspx" tabIndex='1'
     >Connection Preferences</a>
 
</div>
 
    
<div class="navLogoutAreaDiv">
 
 
<table cellspacing="0" cellpadding="0" width="100%"><tr>
<td align="left" width="50%">
 
  <span id="username" >
    Logged on as: <strong>sk505146</strong>
  </span>
 
</td><td width="50%" align="right">
 
<table class="navUsefulLinks" cellspacing="0" cellpadding="0"><tr>
 
  <td id="logoutLink">
 
    <a href="javascript:location.replace('logout.aspx?CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470')"
       title="Click here to log off from the Web site"
       id="logoutAreaLogoutLink"
    >Log Off</a>
 
  </td>
 
  <td
 class="navLink"
>
 
 
    <a id="logoutAreaReconnectLink"
        href="reconnect.aspx?CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470" target="reconnectFrameWI_b5Aop2rUy9ZhNTqay"
        onclick="addCurrentTimeToHref(this, 'reconnect.aspx?CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470', 'ReconnectId');" 
        title="Click here to resume your paused published resources"
    >Reconnect</a>
 
  </td>
 
  <td
 class="navLink"
>
    <a id="logoutAreaDisconnectLink"
        href="javascript:location.replace('disconnect.aspx?CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470')"
        title="Click here to pause your published resources and return to the Logon screen"
    >Disconnect</a>
 
  </td>
 
</tr></table>
</td></tr></table>
 
 
</div>
 
    <div class="spacer"></div>
 
  <div class="mainPane" id="appMainPane">
    <div id="mainTopPane" class="sideBySidePane">
      <div class="leftSide">
        
<div id="feedbackArea"  class="noFeedback" >
 
</div>
 
        
<div id="welcomeMessage">
 
</div>
      </div>
      
<div id="searchPane" class="rightSide">
 <form action="javascript:redirectToSearchResults()" >
   <div> 
    <input type="text" maxlength="60" title="Search for applications, content, and desktops" id="searchEntry"
           onfocus="searchTextFocus(this);" onblur="changeSearchBtnImage(false);"/>
      <a id="graphic_SearchButton" href="javascript:redirectToSearchResults()"  onmouseover="changeSearchBtnImage(true);"
         onmouseout="changeSearchBtnImage(false);" title="Search for applications, content, and desktops"
      ><span>Search</span></a>
      
      <input id="highContrast_SearchButton" type="submit"
             onclick="javascript:redirectToSearchResults()"
             title="Search for applications, content, and desktops"
             value='Search'
      ></input>
   </div>
 </form>
</div>
 
      <div class="spacer"></div>
    </div> 
    <div class="spacer"></div>
    
<div class="mainContainer">
    
    <div id="tabHeader">
        <ul>
        
          <li id="Applications" class="otherTab" onmouseover="" onmouseout="">
            <div class="leftDoor">
              <div class="rightDoor">
                <a id="Applications_Text" class="tabText" href="default.aspx?CTX_CurrentTab=Applications"><span>Applications</span></a>
                
              </div>
            </div>
          </li>
          
          <li id="Desktops" class="selectedTab" onmouseover="" onmouseout="">
            <div class="leftDoor">
              <div class="rightDoor">
                <a id="Desktops_Text" class="tabText" ><span>Desktops</span></a>
                
              </div>
            </div>
          </li>
          
        </ul>
    </div>
    <div id="tabFooter"><!-- --></div>
     <div class="selectedTabContent">
 
 
<div class="displayTools"> 
<div class="displayToolsInner">
 
<table><tr>
  <td id="displayToolsMainCell">
<span class="breadcrumb"><a id="breadcrumbLink_0" href='default.aspx?CTX_CurrentFolder=%5c'>Main</a> &gt;</span> <span class="breadcrumb lastBreadcrumb">Hyperion</span>
 
  </td>
  <td id="displayToolsControlsCell">
    <ul>
 
    <li id="changeView">
      <select id="viewlist" class="hiddenViewList"><option></option></select>
    </li>
 
    </ul>
  </td>
</tr></table>
 
</div>
</div>
 
<script type="text/javascript"> 
   // clear all the elements in the array before we render the page.
   delayedLaunchDesktops = [];
</script>
<table class="desktopView">
 
         <tr class="row0">
           <td class="desktopColumn">
              <a href="launcher.aspx?CTX_Application=Citrix.MPS.Desktop.GLOBAL.Hyperion%20309&CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470" onclick="resetSessionTimeout();clearFeedback();addCurrentTimeToHref(this,'launcher.aspx?CTX_Application=Citrix.MPS.Desktop.GLOBAL.Hyperion%20309&CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470','LaunchId');launch(this.href); return false;" onmousedown=" addCurrentTimeToHref(this,'launcher.aspx?CTX_Application=Citrix.MPS.Desktop.GLOBAL.Hyperion%20309&CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470','LaunchId');" class="iconLink" title="Hyperion 309"><img  src="icons.aspx?size=normal&amp;id=CDDHLKPLOJLHCKAKFMCKDPJDHIDHFCKP" alt="Hyperion 309" title="Hyperion 309"/> <span><strong>Hyperion 309</strong></span></a> </td>
           <td class="restartColumn">
 
           </td>
         </tr>
 
         <tr class="row1">
           <td class="desktopColumn">
              <a href="launcher.aspx?CTX_Application=Citrix.MPS.Desktop.GLOBAL.Hyperion%20310&CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470" onclick="resetSessionTimeout();clearFeedback();addCurrentTimeToHref(this,'launcher.aspx?CTX_Application=Citrix.MPS.Desktop.GLOBAL.Hyperion%20310&CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470','LaunchId');launch(this.href); return false;" onmousedown=" addCurrentTimeToHref(this,'launcher.aspx?CTX_Application=Citrix.MPS.Desktop.GLOBAL.Hyperion%20310&CTX_Token=DCE18B9D3F987A17A84C2AAE9B1AB470','LaunchId');" class="iconLink" title="Hyperion 310"><img  src="icons.aspx?size=normal&amp;id=CDDHLKPLOJLHCKAKFMCKDPJDHIDHFCKP" alt="Hyperion 310" title="Hyperion 310"/> <span><strong>Hyperion 310</strong></span></a> </td>
           <td class="restartColumn">
 
           </td>
         </tr>
 
 
</table>
 
 
<div class="spacer"></div>
 
 
 
      <div class="hintArea">
        <table cellspacing="0" cellpadding="0">
          <tr>
          <td>
          <p>
         Hint: You can connect to this site by browsing to http://localhost/Citrix/XenApp/mobile on your mobile device.
           </p>
          </td>
          
          <td>
          <p>
           <a title='Close hints area'  onmouseover="changeCloseImage(this, true);" onmouseout="changeCloseImage(this, false);"
              id="closeHintsLink" href="default.aspx?CTX_CloseHintsArea=CloseHintsArea&amp;CTX_CurrentTab=Desktops"
              ><img alt='Close hints area' src="../media/CloseHint.gif" /></a>
          </p>
          </td>
          
          </tr>
        </table>
      </div>
 
  </div> 
</div>
 
    <div class="spacer"></div>
  </div> 
<div id="usefulPane">
 
  <table class="navUsefulLinks" cellspacing="0" cellpadding="0" align="right"><tr>
<td>
 
          <a id="lowGraphicsLink"
            href="changeMode.aspx?LayoutType=Compact"
            title="Click here to switch to the compact user interface"
          >Low Graphics</a>
</td>
<td class="navLink">
        <a href="changepassword.aspx" id="usefulChgPwdLink"
        >Change Password</a>
    </td>
<td
     class="navLink">
        <a id="usefulClientDetectionLink" href="clientDetectionPreInputs.aspx?TOOLBAR=True"
        >Problem Connecting?</a>
    </td>
</tr></table>
 
</div>
 
  
<div id="sysMessage">
 
     <!-- -->
 
</div>
  </div> 
          <div id="heightFiller"><!-- --></div>
          
<div id="footer">
  <img src="../media/CitrixWatermark.gif" alt="" />
 
</div>
 
     </div> 
  </div> 
  </div> 
    <div class="HiddenDiv" id="launchDiv"><!-- --></div>
    <iframe width="0" height="0" class="HiddenIframe" id="reconnectFrameWI_b5Aop2rUy9ZhNTqay" name="reconnectFrameWI_b5Aop2rUy9ZhNTqay"title="The hidden frame for the session reconnection functionality" src="../html/dummy.html"></iframe>
    <iframe width="0" height="0" class="HiddenIframe" id="retryPopulatorFrameWI_b5Aop2rUy9ZhNTqay" name="retryPopulatorFrameWI_b5Aop2rUy9ZhNTqay" title="The hidden frame for the delayed launch functionality" src="../html/dummy.html"></iframe>
 
    <iframe width="0" height="0" class="HiddenIframe" id="timeoutFrameWI_b5Aop2rUy9ZhNTqay" name="timeoutFrameWI_b5Aop2rUy9ZhNTqay" title="The hidden frame for the session timeout functionality" src="../html/dummy.html"></iframe>
 
<div id="lightbox">
  <table class="glowBox dynamicGlowBoxMargin" cellpadding="0" cellspacing="0" align="center">
    <tr>
      <td class="glowBoxTop glowBoxLeft glowBoxTopLeft"></td>
      <td class="glowBoxTop glowBoxTopMid"></td>
      <td class="glowBoxTop glowBoxRight glowBoxTopRight"></td>
    </tr>
    <tr>
      <td class="glowBoxLeft glowBoxMidLeft"></td>
      <td class="glowBoxMid">
        <img id="logo" width="80" height="125" src="../media/XenLoginIcon.png" alt="" />
        <div id="lightboxHeading"><p>Restart</p></div>
        <p id="lightboxMessageTop">This will shut down and restart {0}.</p>
        <p id="lightboxMessageBottom">Any unsaved work may be lost.</p>
        <div id="cancelButtonPane" class="lightboxButtonPane"><a
             href="javascript:hideLightbox(false);"
             onmouseover="changeButtonColor('cancelButtonBg', true);"
             onmouseout="changeButtonColor('cancelButtonBg', false);"
             onfocus="changeButtonColor('cancelButtonBg', true);"
             onblur="changeButtonColor('cancelButtonBg', false);"
             tabIndex="2"
        ><span>Cancel</span><img id="cancelButtonBg" src="../media/LoginButtonGlow.gif" alt="" /></a>
        </div>
 
        <div id="okButtonPane" class="lightboxButtonPane"><a
             href="javascript:hideLightbox(true);"
             onmouseover="changeButtonColor('okButtonBg', true);"
             onmouseout="changeButtonColor('okButtonBg', false);"
             onfocus="changeButtonColor('okButtonBg', true);"
             onblur="changeButtonColor('okButtonBg', false);"
             tabIndex="1"
        ><span>OK</span><img id="okButtonBg" src="../media/LoginButtonGlow.gif" alt="" /></a>
        </div>
      </td>
      <td class="glowBoxRight glowBoxMidRight"></td>
    </tr>
    <tr>
      <td class="glowBoxFooter glowBoxLeft glowBoxFooterLeft"></td>
      <td class="glowBoxFooter glowBoxFooterMid"></td>
      <td class="glowBoxFooter glowBoxRight glowBoxFooterRight"></td>
    </tr>
  </table>
</div>
 
<div id="lightboxMask"></div>
 
 
</body>
</html>

Share this post


Link to post
Share on other sites

Posted

Try this :

$oDoc = _IEDocGetObj($oIE)
$oArray = $oDoc.getElementsByTagName("a")

for $element in $oArray
if $element.title="Hyperion 310" then _IEAction ($element,"click") ;hope this is the link as you havent specified
next

This should work , but if doesnt i will have to check all the java code.

Share this post


Link to post
Share on other sites

Posted

I get an Autoit Error:

Line 0 (File "C:\My Documents\Programs\Citrix.exe"):

$o_object.Click ()

$o_object.Click ()ERROR

Error: The requested action with this object has failed.

The link I'd like to click is "Hyperion 309" (which I've adjusted in the suggested line).

I've tried to change getElementsByTagName("a") with getElementsByTagName("Hyperion 309") but it didn't work.

I've tried to change $element.title with $element.value but it didn't work either.

What a stubborn link...

Share this post


Link to post
Share on other sites

Posted (edited)

Then try his one instead:

$oDoc = _IEDocGetObj($oIE)

$oArray = $oDoc.getElementsByTagName("a")

for $element in $oArray

if $element.title="Hyperion 309" then

;$element.FireEvent("onmousedown")

$element.FireEvent("onclick")

endif

next

It should start the onclick event. What hapens if you just click on it and hold your mouse (on mouse down event)

Edited by Juvigy

Share this post


Link to post
Share on other sites

Posted

Here you go:

_IEImgClick($oIE, "Hyperion 309", "alt")

Dale

@Juvigy - I notice that in many of the examples you post you use _IEDocGetObj to get a reference to the Document object. When using the _IE functions this is never necessary as the functions automatically find the document object when needed and create that reference for you. This means that you can pass in $oIE as you will see as a convention in all of the examples in the helpfile. This is one of the key conveniences of using IE.au3 as it takes a lot of the tedium out of coding to the DOM that is required in other environments.

Share this post


Link to post
Share on other sites

Posted

My Bad - i didnt notice it was an image link.

Normally that is how i am used to do it. The hard way when it comes to objects:)

Share this post


Link to post
Share on other sites

Posted

_IEImgClick($oIE, "Hyperion 309", "alt")

OMG, that worked!!!

Juvigy, DaleHohm, THANK YOU! >_<

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