Solved

Sendkeys problem

Posted on 2011-03-19
6
395 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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 45

Accepted Solution

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

Author Comment

by:hrolsons
ID: 35177536
Brilliant!!!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article discusses how to implement server side field validation and display customized error messages to the client.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

707 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