?
Solved

Sendkeys problem

Posted on 2011-03-19
6
Medium Priority
?
399 Views
Last Modified: 2013-12-04
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
Comment
Question by:hrolsons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 35174151
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
 

Author Comment

by:hrolsons
ID: 35175983
I see what you're saying robberbaron.  I'm looking for the equivalent of your links for Visual Basic 6.
0
 
LVL 12

Expert Comment

by:satsumo
ID: 35176035
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.  

 

Author Comment

by:hrolsons
ID: 35176046
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
 
LVL 46

Accepted Solution

by:
aikimark earned 2000 total points
ID: 35176823
try sending four "8" characters.
0
 

Author Comment

by:hrolsons
ID: 35177536
Brilliant!!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question