Contributions
Re: Finding text within a bitmap
I do have one more question. The sample code uses the default Courier font, but I'm not sure how to specify a different font. The application I am testing uses Tahoma. I looked up the OCROptions object, but I couldn't figure out how to specify the font. Do you know what change I need to make to specify the font? Thanks. ' Call the FindRectByText function with its default options. ' In the list box, the Courier New font is used (it is applied by the OCR ' object by default), so there is no need to specify recognition options. FindRes = OCRObjList.FindRectByText("E-mail")', OCROptionsList)2.8KViews0likes1CommentRe: Finding text within a bitmap
Thanks! I use an older version of TC (I'd love it if my company upgraded), but I was able to find the OCR sample. I didn't realize you could not only extract text but it would tell you where it was. This will be very helpful in keeping my scripts working.2.8KViews1like0CommentsFinding text within a bitmap
In the application I am testing, we add objects to a template. I can click on them to interact with the objects, but TestComplete can't see the object. I access the object by clicking on X-Y coordinates within the template. This normally works, but it will often miss and click away from the object, if, for example, the application isn't sized the way it was when the script was captured. The template the object is on is anXtraScrollableControl object. I don't know if this is possible, but what would be useful is if I could take a bitmap of the template, and return the X-Y location of the desired text. If it returned the coordinates of the center of the "Text Label" string, that would be ideal. That way, I'd always be sure that my clicks would be on target. I expect that TestComplete itself can't do this; I haven't seen anything in the Region compare which lets you search for text. Are there third party tools that could allow you to search a bitmap for text and return a coordinate? Even if such a thing existed, it would slow down my script, but that still might be worthwhile.Solved2.8KViews0likes7CommentsSerial port communication
We do some testing involving serial communications with a device. Right now, we are using Tera Term to communicate. I'd like to bypass the terminal program entirely and just have TestComplete send strings to the device and receive responses. Does anyone have any sample code of how I can do this?2.5KViews0likes6CommentsRe: TestExecute not recognizing objects on my application.
For some reason, I don't see Sys under here. (Workbench is my application). It does work when I have the script start the application, but I am curious why it didn't work otherwise. If I don't figure it out, I'll be OK. Thanks again2.2KViews0likes1CommentRe: TestExecute not recognizing objects on my application.
I really don't know what properties are used to map the application. I have TestComplete open, and I'm looking at Mapped Objects, but I don't know what to look for. The application is running, I can see it. I start the application manually before running the test, because there is manual setup I have to do anyway. I may add functionality to have my script start the app later. I could try having the script start the application and see if that helps. As far as I can tell, the application is running under the same user as TestExecute is.2.2KViews0likes4CommentsRe: TestExecute not recognizing objects on my application.
The application has the same name and the same path as it does on the computer where TestComplete is installed. How do I check the NameMapping properties on the computer where I am running TestExecute? I tried bypassing NameMapping by changing the objects to their full name, but that didn't help; it couldn't find the process. Is there any way of logging the processes that are running so that I can see if it is named something different than I expect?2.2KViews0likes7CommentsTestExecute not recognizing objects on my application.
I have a script that works fine when I run it on TestComplete. It also works fine when I run TestExecute on the same computer that TestComplete is installed. But when I run TextExecute on a different computer, it doesn't recognize objects on my application. I look in the log and I see: Object That Was Not Found Alias: Aliases.MyApp Name Mapping Item: NameMapping.Sys.MyApp. Is there anything I need do to make sure TestExecute will properly use NameMapping? I am using TestComplete/TestExecute 9.2.2.2KViews0likes9CommentsRe: Can Test Complete 11 detect if a string is cut off?
I did figure this out. Log.Message T1.WndCaption Set OCRObjWord = OCR.CreateObject(T1) Set OCROptionsWord = OCRObjWord.CreateOptions ' Add font to the Options object. Set FontItem = OCROptionsWord.Fonts.Add ' Specify the font name. FontItem.Name = "Arial" ' Add the font size. Call FontItem.Sizes.Add(10) ' Add the bold style. Call FontItem.Styles.Add(1) ' Call the GetText function with the specified options. Call Log.Message("Recognized word: " + OCRObjWord.GetText(OCROptionsWord)) I can use the OCR to look at what is actually displayed and compare that to the field value is. If what is displayed is shorter, then the string is cut off.1.6KViews0likes0Comments