Forum Discussion
For loop line where i am trying to convert string to int. This trying thru OCR. is there any other way we can select a random value from list table. in the properties there is no witem or itemlist for me to loop thru.
Try the aqConvert StrToInt
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/methods.html
- GAutomation6 years agoFrequent Contributor
Attached is the screen and the whole list is considered as 1 text file. so ima not able to select a randon string value.
- Marsha_R6 years agoModerator
Then I'm not sure why converting the list string to an integer would do you any good at all.
What will the test do once it has a list item to work with? Perhaps there's a another way to move forward.
- tristaanogre6 years agoEsteemed Contributor
Well, first of all
1) You can't convert ANY of that to an integer if each line in the file is one of the elements. It's not an integer value so you will ALWAYS get an error
2) If you want to use each row as a particular item, probably what would be better would be to download the contents to something like a CSV file or read the text in as a text string with delimiters on the carriage return. You can the work with it using the aqString object and the methods for delimited strings.
- AlexKaras6 years agoChampion Level 3
Hi,
If I got the problem and the screenshot right, then you seem to have a property (FullTExt) that is a text splitted to several lines. So why not to count the number of lines, get a random number in the [1...NofLines] range and select the line by that number?
Does this help?
- GAutomation6 years agoFrequent Contributor
Alex,
I tried with curobject.highlight.fulltext.Linescount but the lines count method is not working. Will u be able to give me a sample code.
Related Content
- 2 years ago
- 3 years ago
Recent Discussions
- 15 hours ago
- 15 hours ago