mercredi 21 janvier 2015

How to read a GUI application in Python?

I want to automate one of my tasks, by changing a third-party GUI application's properties as per my requirements. Every time I need to carry out any testing, I need to change the properties of the application to test my software.


I tried to automate it by using Python and IronPython. After Googling a lot I found IronPython, because the GUI is written C# and VB.NET.


Suppose when opening the GUI in its editor it gives me the option to edit the properties, e.g.:



Enter Time |__| //Need to enter the value in the box
Enter the dealy |__| //Need to enter the value in the box
Want to display |_| //Check box , check or uncheck
some Radio buttons.
Some more controls.
....
....


I want to control all the changes from my Python script. I will just enter the value from my script and it will update them in the GUI.


I wrote a script in IronPython to read the GUI:



fw = open("MyFile.vnb", 'r')
for line in fw.readlines():
print (line)


I found plenty of encrypted/encoded characters along with some of the C#/VB.NET codes in the console. So, I am completely stuck here.


I would like to know can we edit a third-party GUI with Python/IronPython or not? Do I need to use some special tools from Python to edit the GUI?


Aucun commentaire:

Enregistrer un commentaire