Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send the TAB button using Python In SendKey and PywinAuto Modules

This is the my code which will open the window and send the keys to the window but some screen s are not working

from pywinauto.application import *
import time
app=Application.Start("Application.exe")
app.window_(title="Application")
time.sleep(1)
app.top_window_().TypeKeys("{TAB 2}")
like image 290
user1575730 Avatar asked Aug 11 '12 11:08

user1575730


1 Answers

  1. Be sure you are using exactly needed window. top_window_() may return quite another window.

To check, run:

app.top_window_().DrawOutline() #Highlight the window

2.The window can be not active, set it focus before the typing:

window = app.top_window_()
window.SetFocus()
window.TypeKeys("{TAB 2}")

3.More, you may need to click on the window.

window.Click()
window.TypeKeys("{TAB 2}")
like image 94
SWAPYAutomation Avatar answered Nov 14 '22 21:11

SWAPYAutomation