2018 up to now | 2017 | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2011

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QF-Test] autowin.py does not include VK_TAB

  • Subject: [QF-Test] autowin.py does not include VK_TAB
  • From: Sean Cook <qftest@?.net>
  • Date: Tue, 7 Jun 2011 14:03:14 -0500

I'm trying to use the autowin.py that is included in the qftest system and i have a specific need to select an option via ALT-A and then 'tab', followed by the 'space' key. It seems that the autowin.py includes many of the common VirtualKeys including 'space' and 'alt', but it does not include 'tab'. It also seems that a mapping for KEY_DOWN is not present.

Is there a reason for this?

I have manually set the key in my Jython Server script as follows:

import autowin
from com.jniwrapper.win32 import Msg

win = autowin.waitForWindow(rc.getInt("timeout"), rc.lookup("title"), 1)
if not win:
    raise UserException ("Certificate dialog did not appear.")


#use the virtual key combination of ALT-A (alt down, a down, a up, alt up)
key = (ord('A'))
autowin.keybd_event(autowin.VK_MENU, 0)
autowin.keybd_event(key, 0)
autowin.keybd_event(key, autowin.KEYEVENTF_KEYUP)
autowin.keybd_event(autowin.VK_MENU, autowin.KEYEVENTF_KEYUP)

#use the virtual key combination of tab (tab down, tab up)
tab = (0x09)
autowin.keybd_event(tab, 0)
autowin.keybd_event(tab, autowin.KEYEVENTF_KEYUP)

#use the virtual key combination of space (space down, space up)
autowin.keybd_event(autowin.VK_SPACE, 0)
autowin.keybd_event(autowin.VK_SPACE, autowin.KEYEVENTF_KEYUP)