Working with regular expressions in python
Need a solution on how exactly we can find a particular text using OCR.
TEXT : "Number = 10 Value = Some Number"
So, This is the text that's getting displayed in the desktop application window. We have texts of the same kind but with different numbers and values which keeps changes.
But, I need to find if there exists a correct value which is correct for a particular number. If we can use
Value = OCR.Recognize(Object)
After that we can use Value.FullText
But, how we can find value for a particular number only.
Is there one element containing all text values, or a series of elements with different values?
If you are using OCR to extract the fulltext from an element and validating the content, you can use the CheckText method along with wildcards to check if the extracted text contains a required value. Examples here : https://support.smartbear.com/testcomplete/docs/reference/program-objects/ocrtextdocument/checktext....
Hope this helps,
Hi@mikef , Thanks for replying.
There are series of values for a particular number
Number =1 Value=12345.89
These values change each time. So, wanted to validate the value for one of the numbers.
Wanted to check how can we do it with regular expressions using python
Hi @mikef , The values that will be in a particular range for a particular number, say for example, for number one it will be around 12000-13000 in that range.
I'm just not entirely sure of how the app-under-test looks; whether you are trying to find a specific element in a group of elements, or just validate a single value exists in a text block.
This example shows how to loop through a set of elements to find a specific block, including using regular expressions:
If you could share a screenshot or a more detailed description it may help.