I'm trying to load a ".txt" file from local to MFC application using pywinauto or at-least I need to able to type the text in the "File name:" section and then able to click Open button (as shown in the below screenshot).
Following is the code which i'm using:
from pywinauto.application import Application
import time
app = Application().Start(cmd_line=u'"path of the application (.exe)" ')
window = app.Dialog
window.Wait('ready')
button = window.Button
button.Click()
app.Open.edit.SetText("Test_File%r.txt" % b)
app.Open.Open.Click()
I searched many blogs for this and couldn't find the solution. Any help is appreciated!!! Thanks.
I made progress on this and it worked for me.
Below is the code which i'm using now:
from pywinauto.application import Application
import time
import ctypes
app = Application().Start(cmd_line=u'"path of the application (.exe)" ')
window = app.Dialog
window.Wait('ready')
button = window.Button
button.Click()
button2 = window.Button10
button2.Click()
app.Open.edit.SetText("Hello.txt")
time.sleep(2)
app.Open.Open.click_input()