You are viewing limited content. For full access, please sign in.

Question

Question

Connector - profile to target specific control

asked on October 12, 2017

I'm using Connector 10.2 and targeting a .Net WinForm app. Here is the definition of the control to be analyzed:

<Attributes>
  <Attribute name="Condition" value="/Root[1]/Pane[1]/Window[1]/Text[2]" />
  <Attribute name="Property" value="Label" />
</Attributes>

My WinForm app uses MDI and Childforms. I added a control just for the Connector on several child forms. This works in most cases but I have a few problem forms where the wrong control is analyzed. Given the control path shown above Connector is obviously walking the the discovered controls by type. 

Looking at the LFC.TestUtility.exe logs (which doesn't show the above syntax) it does find all the controls and it has discovered the names of the controls.

I am wondering if there is alternative syntax that could be used to target a control by name?

Failing that how can I modify my WinForm to control the order of the controls so they are consistent across childforms?

 

 

 

0 0

Answer

SELECTED ANSWER
replied on October 15, 2017

Yes, you can. Actually, the control path is an XPath, see https://en.wikipedia.org/wiki/XPath

The XPath is generated based on the XML connector produces, you can find it in the same folder of log files when running LFC.TestUtility.exe.

So if you can modify the WinForm, please give the control a unique name across multiple child forms, then change the control path something like "//control[@name='xxxx'". 

0 0

Replies

replied on October 16, 2017

The logs are in ..Documents\LaserFiche Connector

The test log for target control:

<Edit AutomationId="txtSite_ID" 
ClassName="WindowsForms10.EDIT.app.0.ae65b0_r14_ad1" 
Name="" NativeWindowHandle="264428" Top="483" Left="422" Bottom="24" Right="62"
ChosenPattern="192" VV="399" 
Digest="-Edit-WindowsForms10.EDIT.app.0.ae65b0_r14_ad1-399----" 
Id="42,264428" />

Note Name is empty.

This one worked:

<Element name="%(Site_ID)">
  <Attributes>
    <Attribute name="Condition" value="//Edit[@AutomationId='txtSite_ID']"/>
    <Attribute name="Property" value="Value" />
  </Attributes>
  <Children />
</Element>

So this technique worked - HOWEVER....

When the Connector evaluates a Winform MDI with multiple windows open all the child forms are evaluated and the values from each form are returned which breaks the search. 

Search parm with one child open: Basic~=%22399%22

With two child forms open:              Basic~=%223082;399%22

If the installed connector only evaluated the top child window, as the test tool does, it would work.

 

 

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.