scsvel
October 4, 2024, 1:56pm
1
I am trying to find the exact text using not preceded by but it seems not working or getting syntax error.
I have 2 dynamic texts like ABC XYZ and XYZ; and I need to click XYZ. So I tried the command like:
WaitFor 5, text: <not preceded by (2 chars), "XYZ">, SearchRectangle: my_rect --not finding
WaitFor 5, text: <preceded by (0 chars), "XYZ">, SearchRectangle: my_rect --finding ABC XYZ but not the XYZ
--below commands are throwing the error
*[waitFor error - Image property list did not contain "ImageName" property]*
WaitFor 5, text: <not preceded by (1 or more chars), "XYZ">, SearchRectangle: my_rect
WaitFor 5, text: <not preceded by (any chars), "XYZ">, SearchRectangle: my_rect
WaitFor 5, text: <not preceded by (some chars), "XYZ">, SearchRectangle: my_rect
I don’t understand why these patterns are not working or why is it saying imagename property not found. Appreciate any help here.
1 Like
The last three seems to be violating the constrained length rule on preceded by
pattern as mentioned in Anchors with SenseTalk's Pattern Language | EPF Docs
Important: The locatingPattern used with preceded by
must be of a constrained length. It cannot include patterns that have an indeterminate, unconstrained length, such as preceded by some characters
or preceded by one or more digits
. A variable but constrained length is allowed, such as preceded by 3 to 5 digits
. Patterns used with followed by
do not have this limitation.
2 Likes
scsvel
October 7, 2024, 1:29pm
3
Thanks, I will try.
I would have found the issue if the error is at least somewhat nearby the reason.
Hey @scsvel ,
couldn’t agree more with your last statement.
Ran into all this when I first used the patterns.
Keiichi’s reply is correct. Preceded must be a defined range or a amount. It cannot be used with a wildcard such as any, some, many etc.
Cheers,
Karsten
1 Like