I would like to automate application programs, from opening the file until automatically working on it. Currently i am learning python and i am using pyautogui & pywinauto, but seems i am having difficulties.
this is an example of what i am working on:
import os
import time
import pyautogui
import subprocess
#import cv2
#from pywinauto.application import Application
batLoc = 'D:programcaller.bat'
subprocess.Popen(batLoc)
moveToTaskBar = pyautogui.moveTo(1380, 1150, 0.5)
pyautogui.click(moveToTaskBar)
clickExe = pyautogui.locateOnScreen("clickExe.png")
pyautogui.click(clickExe)
# input correct logincode
#username
pyautogui.write("00000101")
pyautogui.hotkey("enter")
#password
pyautogui.write("101")
pyautogui.hotkey("enter")
#------script working until here--------
if pyautogui.locateOnScreen("clickAdd.png"):
pyautogui.moveTo(44,44)`your text`
#------from above if statement not working---`
after opening the application
im done inputing some details on login, it works fine
Thanks for your future suggestions
after logging in, wanted to click buttons inside but I wanted to validate first if the button i wanted to click was there,if so, will click it, else return a message.
Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.