如何自动执行Windows窗体应用程序上的某些操作? [英] how to automate some actions on Windows form Application?

查看:45
本文介绍了如何自动执行Windows窗体应用程序上的某些操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已创建的工作Windows窗体桌面应用程序.该应用程序每月执行一些工作.每个月我都需要运行该应用程序,并且有一个连接按钮.我单击它,然后它在下拉菜单中加载了一些列表,然后选择其中一个列表,然后单击另一个按钮来完成该工作.因此,我想做的就是使这一过程自动化,并让应用程序按计划每月为我完成这项工作.我不想深入编写代码,使其成为控制台应用程序,并从任务计划中运行控制台应用程序.我只是想知道有什么方法可以创建另一个小型应用程序并定义要为我完成工作的步骤(类似的宏或测试项目(codedUI测试))?

I have a working windows form desktop application that I have created. The application is doing some jobs on monthly basis. Every month I need to run the application and there is a connect button. which I click and then it loads up in a dropdown menu some lists and I choose one of them and click another button to do the job. So what I would like to do is automate this process and just let the application to do this job for me every month as a scheduled. I do not want to go inside to code and make it a console application and run the console application from tasks schedule. I am just wondering is there any way that I can create another small application and define the steps to take (similar Macros or test projects(codedUI Test)) to do the job for me?

推荐答案

我建议您自动机-Python工具/library用于自动化GUI应用程序.它非常易于使用,非常适合您描述的任务:

I recommend you Automa - Python tool/library for automating GUI applications. It's very easy to use and perfect for tasks you described:

click(Button("Connect"))
click(ComboBox("Drop Down Menu Name"), "Option 1")
press(ENTER)

您可以将命令保存在扩展名为.at的文本文件中,并在需要时从命令行轻松运行:

You can save the commands in a text file with the .at extension and run it easily from command line whenever required:

> Automa.exe your_script.at

免责声明:我是Automa的开发人员之一.

这篇关于如何自动执行Windows窗体应用程序上的某些操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆