Keyword Test - Get new Id value from textbox
I apologize ahead of time in case the answer to my question should be obvious. I have not been able to find it.
I want to run a desktop app that creates a new widget. Once the widget is saved, the new Id appears in a textbox. I want to get the Id from this textbox and save it in a csv file to use as input to another test.
Recording the test works great. How do I hook to the textbox, get the value from it, and write it to a file?
So, you're doing a Keyword test.
Well, what you're going to want to do is use a Set Variable operation to create and set a variable to equal to a property value. In that operation, you'll select, for the value, an Onscreen Object Property and then use the picking control to grab the object and find the appropriate property.
Writing out to a file is a bit trickier, I'm afraid. There is a "Save to File" operation but I think that would overwrite the file every time rather than append to it.
So, instead, use the "Call Object Method" operation and find the aqFile object. Then use the WriteToTextFile method and fill in the appropriate parameters as per https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfile/writetotextfile.html
The "String" would be the variable that you created with the content.