Hi,
Was looking for some advice from anyone who has experience using Squish for GUI testing WinCC OA panels.
I've made a simple test panel which has a few push button objects on, to set a DPE to various values ranging between 0-100.
I've then placed a text field which displays the current value of the DPE, and a rectangle object (just using the standard drawing tools within GEDI) which changes size and colour depending on the DPE value, to imitate a bar graph object.
Using Squish, I'm able to record a test and interact with the push buttons, and the text field, but I cannot seem to get Squish to recognise the rectangle object (I've tried using the object picker, adding a click event to it and selecting it whilst recording etc).
When I click on the rectangle and check the script afterwards, it is just referencing the "PanelQT" itself as opposed to the object.
After reading in the help file about the available QT classes, they all seem to be more complex objects.
Is the problem that the rectangle isn't a QT object? Is there any way to 'see' this object within Squish to verify it's properties?
Any tips much appreciated!
Kind regards,
Phil
GUI Testing with Squish
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: GUI Testing with Squish
Hi Phil,
Yes you figure it right, you cannot pick primitive objects using squish picker. However they are still accessible using script for some mapped properties (QString foreCol, QString backCol, bool visible, bool enabled, bool selected).
The way to do it (3,16 + squish 6.5.0) and considering that WCCOAui is your AUT:
Hope it will help you 
BR
Alexandre
Yes you figure it right, you cannot pick primitive objects using squish picker. However they are still accessible using script for some mapped properties (QString foreCol, QString backCol, bool visible, bool enabled, bool selected).
The way to do it (3,16 + squish 6.5.0) and considering that WCCOAui is your AUT:
Code: Select all
function main()
{
ctx = startApplication("WCCOAui -proj yourprojectname -p yourpanelname -lang de_AT.utf8 -user root:");
var panel = waitForObject(":etmPanelAreaPanelQT");
logProperties(panel.getShape("RECTANGLE1"));
}
function logProperties(obj)
{
var text = obj.property("backCol").toString();
test.log(text);
}BR
Alexandre
- PhilScottNGC
- Posts:3
- Joined: Tue Sep 10, 2013 3:16 pm
Re: GUI Testing with Squish
Hi Alexandre,adaneau wrote: ↑ Fri Jun 28, 2019 5:01 pm Hi Phil,
Yes you figure it right, you cannot pick primitive objects using squish picker. However they are still accessible using script for some mapped properties (QString foreCol, QString backCol, bool visible, .....
Thank you for your reply.
Is this described in any documentation that you know of?
I'm using Python in Squish so have adapted your code as follows:
Code: Select all
import names
def main():
attachToApplication("WCCOAui")
panel = waitForObject(names.etmPanelArea_Test_Screen_PanelQT)
logProperties(panel.getShape("RECTANGLE1"))
def logProperties(obj):
text = obj.property("backCol").toString()
test.log(text)
Thanks again,
Phil
- PhilScottNGC
- Posts:3
- Joined: Tue Sep 10, 2013 3:16 pm
Re: GUI Testing with Squish
Had a bit of a play and seems to be working now using the different method of converting to a string in Python.
Code: Select all
def main():
attachToApplication("WCCOAui")
panel = waitForObject(names.etmPanelArea_Test_Screen_PanelQT)
logProperties(panel.getShape("RECTANGLE1"))
def logProperties(obj):
text = obj.property("backCol")
test.log(str(text))