Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sendkeys problem

Posted on 2011-03-19
6
Medium Priority
?
402 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
Suggested Courses

650 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