Forum Discussion
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?
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.
- AlexKaras5 years agoChampion Level 3
Hi,
> curobject.highlight.fulltext.Linescount
Is .linescount a property that you see in the Object Browser/Object Spy for the target object?
I would recommend to try something like this:
aqString.GetListLength(<object>.FullText)
See documentation for more details about this and other methods of the aqString object.
- GAutomation5 years agoFrequent Contributor
Full text has a method
Blockbytext and checktext
Tried the below code
min =1
max =aqstring.Getlength(curobject.fulltext)
randomize
rand=Int(max-min+1)*Rnd+min)
log.message(curobject.block(rand).blockbytext)
did not work as fulltext will need a string
also tried converting that to string still no luck.
- AlexKaras5 years agoChampion Level 3
Hi,
This is something that you must investigate yourself using Object Browser and talking to your developers. Just because we know nothing about your tested application.
> Full text has a method [...]
> fulltext will need a string [...]
From what I can see on the previously provided screenshot:
-- FullText is a property, thus it does not have any methods;
-- FullText is a property and seems already be of string type;
Assuming that
max =aqstring.Getlength(curobject.fulltext)
line of code returns correct number of lines,
does this line returns correct line of FullText property
log.message(aqString.GetListItem(curobject.FullText, rand) ?
If it does, then the only thing you should do if to figure-out how to click correct line in the list (or navigate to it using keyboard by pressing Down Arrow key and confirming selection by pressing Enter key).
Alternative approach that often works for custom or not supported controls is to talk to developers and ask if the required action (selection of list item in your case) can be done using native methods available from the Methods tab in the Object Browser.
Related Content
Recent Discussions
- 3 days agovladd1