I'm trying to automate some GUI testing with Squish and keep getting problems with MFC resource IDs in Squish.
I create a static label like this:
CStatic m_Status;
m_Status.Create("", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE | SS_LEFT,
mCfg->rectStatus(), this, 42);
m_Status.SetWindowText("42 is the answer");
When I spy this label with Squish, all I get is:
{"container": o_Pane, "text": "42 is the answer", "type": "Label"}
however, there's no ID. As the text is changing, matching element based on the text alone is not optimal.
In the same program other labels are created via the resource manager wizard. For those labels Squish is able to get both the resource ID and set the correct "nativeObject" property.
Is there some way to make CStatic objects created in the source code also properly visible to the Squish, with the nativeObject property if possible?