Jump to content

_IEFormImageClick issue


Recommended Posts

Hi there,

I'm using autoit to automate one send email function in Amazon communication website. After clicking the "send e-mail" button, the email will be sent. The source html code for this element is:

<input type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/buttons/send-email._V47060560_.gif"  width="94" align="absmiddle" alt="Send E-mail" value="email" name="sendemail" height="20" border="0" />

_IEFormImageClick function is the function handling this special form element. I tried _IEFormImageClick function to perform the clicking button function, but the result is not same with manual click. The manual click guides me to another webpage showing sending email is successful. The automated click didn't send email and appears webpage going back. The return value indicated _IEFormImageClick was executed successfully.

The function I used is:

_IEFormImageClick ($oIE, "send-email._V47060560_.gif", "src", 0, 1)

I also tried _IETagNameGetCollection to get this image button object and then use _IEAction to perform click. The result is same with _IEFormImageClick.

Did anyone have this kind of whack issue? Thanks for the help!

Lou

Link to comment
Share on other sites

These sorts of behaviour differences are typically caused by the element using more events than just an onclick event.

There is not enough information in what you posted to know what is needed, so if this hint is not enough, please post more detail or instructions on how to test and reproduce at amazon.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

post-37811-1230863843_thumb.png

These sorts of behaviour differences are typically caused by the element using more events than just an onclick event.

There is not enough information in what you posted to know what is needed, so if this hint is not enough, please post more detail or instructions on how to test and reproduce at amazon.

Dale

Thank you Dale. Here is what I want to do and how to do it in Amazon:

I'm selling some stuff in Amazon. After stuff were sold, I need send email to buyer saying I receive the orders bla bla bla. Amazon website has this webpage to perform writing email and then send to buyer. If you already sold some stuff in Amazon, you can search that transaction id and find one link with buyer's name. Click on that, you will go to the email webpage. One of the attachments is this communication webpage capture. The other attachment is the HTML sourcecode.

I'm guessing there is Java Script running after click this button and my automatic click can't triger that javascript.

Thanks for the help.

I tried to attach the txt file for html code. but forum doesn't allow me to do that. So I post here:

<html>
<head>
<script src="/jquery/jquery.pack.js"></script>
<script language="Javascript">
<!--
var gNavbarHeight = 0;
-->
</script>
<script language="Javascript">
<!--
  window.name="rainierWindow";
-->
</script>
<title>Amazon.com : Contact Customer</title>
<style type="TEXT/css" title="currentStyle" media="screen">
     @import "/css/buttons/amzn-buttons.css";
     @import "/css/pipeline/sc-pipeline.css";
     @import "/css/messaging/errormessages.css";
     @import "/css/seller-central-master.css";
</style>
<script language="Javascript" src="/rainier-javascript/amzn-buttons.js"></script>
<style type="text/css" title="currentStyle" media="screen">
     @import "/css/tabs/sc-tabs.css";
</style>
<script language="Javascript" src="/rainier-javascript/AnchorPosition.js"></script>
<script language="Javascript" src="/rainier-javascript/Popupwindow.js"></script>
<script language="Javascript" src="/rainier-javascript/browsersniffer.js"></script>
<script language="Javascript" src="/rainier-javascript/rainier_menus.js"></script>
<script language="Javascript" src="/rainier-javascript/generic-modal-popup.js"></script>
<script language="Javascript" src="/rainier-javascript/sc-tabs.js"></script>
</head>
<body>
    
    
 
<script language="Javascript">
<!--
function showPleaseWait()
{
    // hide all the select boxes
    selectList = document.getElementsByTagName("SELECT");
    for(var selCount = 0; selCount < selectList.length; selCount++ )
    {
        selectList[selCount].style.visibility = 'hidden';
    }  
  
    var mask = document.getElementById("pleasewaitmask");
    var img = document.getElementById("pleasewaitmsg");
    var scrollHeight = 0;
    var scrollWidth = 0;
    if(document.body.scrollTop) scrollHeight = document.body.scrollTop;
    else if(window.pageYOffset) scrollHeight = window.pageYOffset;
    if(document.body.scrollLeft) scrollWidth = document.body.scrollLeft;
    else if(window.pageXOffset) scrollWidth = window.pageXOffset;
    
    var winW = 0;
    if(window.innerWidth) winW = window.innerWidth;
    else if(document.body.offsetWidth) winW = document.body.offsetWidth;
    var winH = 0;
    if(window.innerHeight) winH = window.innerHeight;
    else if(document.body.offsetHeight) winH = document.body.offsetHeight;
    var docHeight;
    var test1 = document.body.scrollHeight;
    var test2 = document.body.offsetHeight
    if (test1 > test2) // all but Explorer Mac
    {
    docHeight = document.body.scrollHeight;
    }
    else // Explorer Mac;
    //would also work in Explorer 6 Strict, Mozilla and Safari
    {
    docHeight = document.body.offsetHeight;
    }
    // set size of mask
    if(mask && img)
    {
        mask.style.height = docHeight;
    mask.style.width = winW;
    // set position of image
    img.style.left = scrollWidth + (winW - 189) / 2;
    img.style.top = scrollHeight + (winH - 102) / 2;
    
    mask.style.visibility = 'visible';
    img.style.visibility = 'visible';
    }
}
function hidePleaseWait()
{
    var mask = document.getElementById("pleasewaitmask");
    var img = document.getElementById("pleasewaitmsg");
    if(mask) mask.style.visibility = 'hidden';
    if(img) img.style.visibility = 'hidden';
}
-->
</script>
<div id="pleasewaitmask" style="position: absolute; top: 0px; left: 0px; width: 100; height: 100; background-color: #ffffff; filter: alpha(opacity=80); -moz-opacity: .8; visibility: hidden"></div>
<div id="pleasewaitmsg" style="position: absolute; top: 0px; left: 0px; width: 189; height: 102; visibility: hidden">
<img src="https://images-na.ssl-images-amazon.com/images/G/01/rainier/misc/loading-please-wait-sc._V47073636_.jpg" width="189" height="102" border="0" /></div>
<script>
<!--
function setExtendedBreadcrumb(exBreadcrumb)
{
  var normalBreadcrumb = document.getElementById("_normalBreadcrumb");
  var alternateBreadcrumb = document.getElementById("_alternateBreadcrumb");
  var extendedBreadcrumb = document.getElementById("_extendedBreadcrumb");
  if(extendedBreadcrumb && alternateBreadcrumb && normalBreadcrumb) 
  {
    normalBreadcrumb.style.display = 'none';
    alternateBreadcrumb.style.display = 'block';
    extendedBreadcrumb.innerHTML = exBreadcrumb;
  }
}
function doLogout()
{
    // make the request object
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
      logoutHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
      logoutHttp = new XMLHttpRequest();
    } 
    // submit it
    var logoutUrl = '/gp/flex/sign-in-sdp.html?action=sign-out&nocache=' + Math.floor(Math.random() * 10000);
    logoutHttp.open('GET', logoutUrl, false);
    logoutHttp.send(null);
    window.location.href = "https://www.amazon.com/gp/flex/sign-out.html?ie=UTF8&path=%2Fgp%2Fseller-account%2Fmanagement%2Fyour-account.html&useRedirectOnSuccess=1&action=sign-out";
}
function simpleMerchChanged( merchantID )
{
  // show the please wait message
  showPleaseWait();
        
  document.location = "https://sellercentral.amazon.com/gp/utilities/set-rainier-prefs.html?ie=UTF8&url=%2Fgp%2Fhomepage.html" + '&merchantID=' + merchantID;
}
var gNavbarHeight = 117;
-->
</script>
<center><table border="0" width="99%" cellpadding="0" cellspacing="0"><tr><td>
<script language="Javascript" src="https://www.amazon.com/gp/seller-account/nav-only-js.html"></script>
<script type='text/javascript'>
n2RunThisWhen(
  'lastlibraryloaded', 
  function() {
  // instantiate a popover object
  merchantPopUp = new N2SimplePopover();
  // register you popup feature with the events framework
  goN2Events.registerFeature('merchantAnchor',
                             'merchantPopUp',
                             'n2MouseOverHotspot',
                             'n2MouseOutHotspot' );
  merchantPopUp.initialize('merchantAnchor',  // the name for your popup DIV. any unique name will do
                          'merchantPopUp', //the object crated and initialized above.
                          null, //used for arrays of popovers
                          null, //reserved
                          'below', 0, 0); //popup goes below, left aligned. 
 },
''); 
</script>
 
<div align="center" class="seamlessbreadcrumbbar"><table width="95%" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap><div id="_normalBreadcrumb" style="display: block"><a href="https://sellercentral.amazon.com/gp/homepage.html">Seller Account: xxxxxx</a></div><div id="_alternateBreadcrumb" style="display: none"><a href="https://sellercentral.amazon.com/gp/homepage.html">Seller Account: xxxxx</a></div></td><td nowrap width="100%" id="_extendedBreadcrumb"></td><td nowrap align="right"><a href="https://www.amazon.com/gp/help/customer/display.html?ie=UTF8&nodeId=1161232">Seller Help</a>&nbsp;|&nbsp;<a href="java script:doLogout()">Logout</a></td></tr></table></div><div
     id="showMerchantsDiv"
      style="display:none;
      border-style: solid;
      background-color: white;
      padding: 5px;">
    <div style="font-size:80%; background-color:white; padding:0">
    <table border="0" cellspacing="0" cellpadding="8" style="border:1px solid
#183490;">
    <tr>
        <td class="tiny" align="left" nowrap="nowrap">
            <strong>Change Merchant:</strong>
            <div style="margin-top:4px; padding-top:2px; border-top:1px dotted
#cccccc; line-height:1.7em;">
               <a href="java script:simpleMerchChanged( 'AAT50CMUN25MB' )">xxxxxx</a>
               <br>
    </tr>
    </table>
    </div>
</div>
</td></tr></table></center>
    
    
<script language="Javascript">
function checkLength( element, maxLength ){
  var len = element.value.length
  if (len > maxLength) {
    element.value = element.value.substr(0,maxLength);
    len = maxLength;
  }
  if ( element.value == "Please limit your text to less than 4000 characters." ) {
    document.getElementById('remChars').innerHTML = maxLength;
  } else {
    document.getElementById('remChars').innerHTML = maxLength - len;
  }
}
</script>
<span class="small">
<p>
<b class="h1">Contact Customer  &gt; Nathan H  Mauldin</b>
    <FORM name="comments" method="post">
      
    <table width="60%" align="center"><tr><td align="right">
          <input type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/buttons/cancel-yellow._V47060251_.gif"  width="55" align="absmiddle" alt="Cancel" value="cancel" name="cancel" height="20" border="0" />
  <input type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/buttons/send-email._V47060560_.gif"  width="94" align="absmiddle" alt="Send E-mail" value="email" name="sendemail" height="20" border="0" />
        </td>
      </tr>
    </table>
    <table border="0" width="60%" align="center">
      <tr>
        <td>
          <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#6699cc" align="center">
        <tr>
          <td width="1%" align="left" valign="top"><img src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/icons/eyebrow-upper-left-corner._V47082426_.gif" width="5" height="5" border="0" /></td>
          <td rowspan="2" align="left" valign="middle">
            <nobr><b><span class="small"><font color="#ffffff">Your E-mail to xxxxxxxx:&nbsp;</font></span></b></nobr>
          </td>
          <td width="98%" valign=middle rowspan="2"></td>
          <td width="1%" align="right" valign="top"><img src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/icons/eyebrow-upper-right-corner._V47081741_.gif" width="5" height="5" border="0" /></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
          </table>
          <table width="100%" cellspacing="2" cellpadding="7" bgcolor="#6699cc" border="0">
        <tr>
          <td bgcolor="#ababab">
            <table width="99%" align="center" bgcolor="#ffffff" cellpadding="0" cellspacing="0" >
              <tr>          
            <td>
              <table cellspacing="2" cellpadding="1">
                <tr>
                  <td>&nbsp;</td>
                  <td class="small"><strong>To:</strong></td>
                  <td class="small">
                Nathan H  Mauldin
                  </td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td class="small"><strong>From:</strong></td>
                  <td class="small">
                xxxxxx
                <span class="tiny">&nbsp;&nbsp;(xxxxxxx@gmail.com)</span>
                  </td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td class="small" valign="top"><strong><nobr>Order ID:</nobr></strong></td>
                  <td class="small">
                xxxxxxxxxxxxxxxx:<br /><li>1 <i>of</i> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br /><span class="tiny"><br/></span>
                  </td>
                </tr>
              </tr>
              <tr>
            <td style="padding:4px">&nbsp;</td>
            <td align="left" class="small" valign="middle"> 
              <b>Subject:</b></td>
            <td class="small" valign="middle">
              <select name="subject">
                <option value="-1">--- Select a Subject ---</option>
                          <option value="RTPC"  >
                          Returns</option>
                          <option value="FDBK"  >
                          Feedback Request</option>
                          <option value="RFNC"  >
                          Refunds</option>
                          <option value="ORIF" selected="true" >
                          Order Information</option>
                          <option value="ADIF"  >
                          Additional  Information</option>
                          <option value="SPMT"  >
                          Shipment Notification</option>
              </select>
            </td>
              </tr>
            </table>
          </td>
        </tr>
          </table>
          <div style="margin-top:7px"></div>
          <table width="99%" align="center" bgcolor="#ffffff" cellpadding="0" cellspacing="0">
        <tr>
          <td>
            <table>
              <tr>
                <td style="padding:4px">
                  &nbsp;
                </td> 
            <td style="padding:4px" valign="top">
              <span class="small">
                Type your message in the box below. We will forward it to the buyer and send you a copy via e-mail. Please do not include HTML or links (URLs) in your message. If you need to refer to an item on the Amazon.com Web site, include the product name and/or the ASIN/ISBN.
                <br />
                <br />
               When you submit this form, your message (along with your e-mail address) will be sent to the buyer. In an effort to prevent the transmission of spurious e-mails, Amazon.com uses filtering technology. Messages that fail this filtering will not be transmitted.
                            </span>
            </td>
              </tr>
            </table>
            <tr>
              <td bgcolor="#ffffff">
            <table width="100%">
              <tr>
                <td style="padding:4px">
                  &nbsp;
                </td> 
                <td width="100%" align="left" class="small"><b>Message:</b></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>
                  <textarea name="comments" id="message" 
                onfocus="if(this.value=='Please limit your text to less than 4000 characters.')this.value='';" 
                onblur="if(this.value=='')this.value='Please limit your text to less than 4000 characters.';" 
                onkeyup="checkLength( this, 4000 );" 
                onchange="checkLength( this, 4000 );" onmouseout="checkLength( this, 4000 );" 
                style="width:98%;" rows="7">Please limit your text to less than 4000 characters.</textarea><br />
  <span class="small">You have <span id="remChars">4000</span> characters left.</span><br />
                  <br />
                  <span class="tiny">
 Notice: This form is for use by Amazon.com sellers to send product- and order-related messages to buyers on our third-party platforms (Amazon Marketplace, Merchants, Auctions, and zShops). The use of this form to send unrelated messages to buyers is strictly prohibited.  Find out more about <a href="https://sellercentral.amazon.com/gp/help/customer/display.html?ie=UTF8&amp;nodeId=468496">Amazon.com's Privacy Notice</a> and <a href="https://sellercentral.amazon.com/gp/help/customer/display.html?ie=UTF8&amp;nodeId=508088">Conditions of Use</a>
                <br />
                  </span>
                </td>
              </tr>
            </table>
            <br />
            <br />
            <div style="margin-top:7px"></div>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
      </td>
      </tr>
      </table>
    <table width="60%" align="center"><tr><td align="right">
  <input type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/buttons/cancel-yellow._V47060251_.gif"  width="55" align="absmiddle" alt="Cancel" value="cancel" name="cancel" height="20" border="0" />
          
  <input type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/buttons/send-email._V47060560_.gif"  width="94" align="absmiddle" alt="Send E-mail" value="email" name="sendemail" height="20" border="0" />
        </td>
      </tr>
    </table>
    </form>
<br clear = "all" />
<table align="center">
  
<tr align="center"><td colspan="2">
<font size="-2">
<a href="https://sellercentral.amazon.com/gp/help/customer/display.html?ie=UTF8&amp;nodeId=508088">Conditions of Use</a>&nbsp;|&nbsp;
<a href="https://sellercentral.amazon.com/gp/help/customer/display.html?ie=UTF8&amp;nodeId=468496">Privacy Notice</a>&nbsp;&nbsp;&copy; 1996-2008, Amazon.com, Inc.</font>
</td></tr>
</table>
<script language="Javascript">
<!--
try { fixButtonWidths(); } catch(e) {}
-->
</script>
</body>
</html>
Edited by madmatrix
Link to comment
Share on other sites

An INPUT TYPE=IMAGE element has some unique behaviours. First and foremost, it acts as a SUBMIT button. It also passes the coordinates of the mouse within the button image when it was clicked as form data (e.g. sendemail.x=23&sendemail.y=16). This is one possible reason for unexpected behaviour -- it may be looking for these coordinates and does not receive them or does not receive expected values with the onclick event is triggered by IE.au3.

If you can allow this IE window to be visible on the screen and take mouse/keyboard focus, the fastest solution would be to use _IEPropertyGet to get the screen coordinates of the button, use MouseMove to move the mouse to it and then use MouseClick. There are other less obtrusive ways to do this, but if this approach work for you it would be the quickest solution. To do anything else will require studying the HTTP request that is generated and the flow of the page when it is opened with the POST method.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • Moderators

An INPUT TYPE=IMAGE element has some unique behaviours. First and foremost, it acts as a SUBMIT button. It also passes the coordinates of the mouse within the button image when it was clicked as form data (e.g. sendemail.x=23&sendemail.y=16). This is one possible reason for unexpected behaviour -- it may be looking for these coordinates and does not receive them or does not receive expected values with the onclick event is triggered by IE.au3.

If you can allow this IE window to be visible on the screen and take mouse/keyboard focus, the fastest solution would be to use _IEPropertyGet to get the screen coordinates of the button, use MouseMove to move the mouse to it and then use MouseClick. There are other less obtrusive ways to do this, but if this approach work for you it would be the quickest solution. To do anything else will require studying the HTTP request that is generated and the flow of the page when it is opened with the POST method.

Dale

Could you get the position of the image and possibly send a control click to those coords? Should still register being clicked at the x-23, y-16 coordinates.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Yes, that should work too.

Just understand that there are screen coordinates, client app coordinates and DOM elelement coordinates at play here. What is important is that the control here is IE -- "[CLASS:Internet Explorer_Server; INSTANCE:1]" and you'll need the client coordinates of the INPUT element (_IEPropertyGet will give these to you).

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

An INPUT TYPE=IMAGE element has some unique behaviours. First and foremost, it acts as a SUBMIT button. It also passes the coordinates of the mouse within the button image when it was clicked as form data (e.g. sendemail.x=23&sendemail.y=16). This is one possible reason for unexpected behaviour -- it may be looking for these coordinates and does not receive them or does not receive expected values with the onclick event is triggered by IE.au3.

If you can allow this IE window to be visible on the screen and take mouse/keyboard focus, the fastest solution would be to use _IEPropertyGet to get the screen coordinates of the button, use MouseMove to move the mouse to it and then use MouseClick. There are other less obtrusive ways to do this, but if this approach work for you it would be the quickest solution. To do anything else will require studying the HTTP request that is generated and the flow of the page when it is opened with the POST method.

Dale

Thank you Dale. I tried MouseMove and then MouseClick after getting the screen coordinate through _IEPropertyGet function. It works. But after clicking that send email button, another new webpage will show up. I need click one link in this website. I use _IELinkClickByText ($oIE, "Seller Account"). It appears $oIE is not valid after using mouse move and click. How can I get the current IE webpage handle? All functions seem only for getting form, element object handle not IE.

Thank you very much for your help.

Link to comment
Share on other sites

Yes, that should work too.

Just understand that there are screen coordinates, client app coordinates and DOM elelement coordinates at play here. What is important is that the control here is IE -- "[CLASS:Internet Explorer_Server; INSTANCE:1]" and you'll need the client coordinates of the INPUT element (_IEPropertyGet will give these to you).

Dale

With this method, I don't need activate the IE window. I think this is better way to do this task. I tried this function:

$x = _IEPropertyGet ($oInput, "browserx")
    $y = _IEPropertyGet ($oInput, "browsery")
    
    ControlClick ("Amazon.com : Contact Customer", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $x, $y)

The $oInput is that button image. But the click event doesn't happen. Is there anything wrong with my code?

Thank you very much!

Lou

Link to comment
Share on other sites

Try moving the mouse with MouseMove (see Opt to set the right mouse coordinate system) and see if it goes where you want it to. $x and $y will be the extreme corner of the element, so you may need to offset into the element (or look at width/2 and height/2 to move to the middle of it).

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • Moderators

SendMessage + WM_MOUSEMOVE + x and y coords converted to Hi/Low, + ControlClick() after.

Or maybe have a look at MouseClickPlus() on the forum.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Try moving the mouse with MouseMove (see Opt to set the right mouse coordinate system) and see if it goes where you want it to. $x and $y will be the extreme corner of the element, so you may need to offset into the element (or look at width/2 and height/2 to move to the middle of it).

Dale

Right. My code works. I use screen coordinate. But the last _IELinkClickByText doesn't work. $oIE doesn't work after this click event happens. I need get the object handle of IE again. But how to do that?

$x = _IEPropertyGet ($oInput, "screenx")
$y = _IEPropertyGet ($oInput, "screeny")
WinActivate ("Amazon.com : Contact Customer")
WinSetState ("Amazon.com : Contact Customer", "", @SW_MAXIMIZE)
MouseMove ($x + 1, $y + 1)
MouseClick ("left")
Sleep (10000)
    
_IELinkClickByText ($oIE, "Seller Account")

Thanks!

Lou

Link to comment
Share on other sites

SendMessage + WM_MOUSEMOVE + x and y coords converted to Hi/Low, + ControlClick() after.

Or maybe have a look at MouseClickPlus() on the forum.

So I still need activate the IE window by using ControlClick? What does Hi/Low means here? I'm a newbie. Don't be angry about my question. :)

Thank you!

Lou

Link to comment
Share on other sites

If a new IE window is opened you need to look at _IEAttach... if it navigates the same window, the same $oIE should be valid.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...