• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Sendkeys problem

I'm trying to automate a repetitive task and having trouble.  I'm using "Sendkeys", but I think Javascript might be getting in my way.

When I tab to the size area (see attached picture) and send a down arrow key, it assumes 4x6 and runs some code when I need to choose 8x12. Size Options
0
hrolsons
Asked:
hrolsons
1 Solution
 
Robberbaron (robr)Commented:
have you tried using the elements of the webbrowser control ratehr than sendkeys.  SendKeys is quite unreliable as it relies upon an application not losing focus or repainting.

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_25082070.html

http://vbcity.com/blogs/jatkinson/archive/2009/12/12/programmatically-entering-and-data-using-the-webbrowser-control.aspx
0
 
hrolsonsAuthor Commented:
I see what you're saying robberbaron.  I'm looking for the equivalent of your links for Visual Basic 6.
0
 
satsumoSoftware DeveloperCommented:
Could you get a handle to the dropdown list and send it a CB_SETCURSEL message?
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
hrolsonsAuthor Commented:
Not quite sure what you mean, the code behind the dropdown is:

            <div class="addsizes">
            Choose from more print sizes:</span>

            <select name="lstSizes" onchange="javascript:setTimeout('__doPostBack(\'lstSizes\',\'\')', 0)" id="lstSizes" class="dropdown">
      <option selected="selected" value="0">--add size--</option>
      <option value="3">4x6</option>
      <option value="2">3.25x5</option>
      <option value="262">4x4</option>
      <option value="7">4x5.3</option>

      <option value="263">5x5</option>
      <option value="8">5x6.5</option>
      <option value="4">5x7</option>
      <option value="264">6x6</option>
      <option value="9">6x8</option>
      <option value="265">8x8</option>

      <option value="5">8x10</option>
      <option value="10">8x10.6</option>
      <option value="211">8x12</option>
      <option value="266">10x10</option>
      <option value="6">10x13</option>
      <option value="72">10x15</option>

      <option value="1">Wallets(4)</option>

</select>
            </div>
0
 
aikimarkCommented:
try sending four "8" characters.
0
 
hrolsonsAuthor Commented:
Brilliant!!!
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now