Having trouble verifying text in table

Asked by Ali Ahmed on 2021-01-06

So for the test I'm creating a new record for table. I'm identifying the text region where it would appear in table and using this line to ID it

tagregion=find("TagCodeTableHeader-1.png").below(51).highlight(6)

and using the following line to store text in object.

 theText=tagregion.text()

when I print it in prints the correct text but when I run the test and view the html report generated it showing it fails since and it

it is grabbing the text but for some reason theres is a extra digit at the end of it which is why it is failing when I do comparison.

However when I go back to run code in run selection its prints the correct text in console once again.

Question information

Language:
English Edit question
Status:
Expired
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2021-01-06
Last reply:
2021-01-22
Simon Plivav (simpliv742) said : #1

If the pick up text is already 'real' alphanumerics, i.e. not an image like graphical "text" representation, you could also use the copy-to -clipboard functionality. Btw, wouldn't you need to use '.getText()' to get a single text string, or also 'readWord()'?

Ali Ahmed (ali13xii) said : #2

I was able to grab text that way. I tried using get getText() I could get it work. Does getText() need a png file to work, correct? because what I want to do is validate a string and check to see if its the same as value the one I entered to see if record was created. And it will be different for each run.
I was not aware of the readWord() was a function in sikuli.

Ali Ahmed (ali13xii) said : #3

I was having issue with validating the text from a clipboard

Launchpad Janitor (janitor) said : #4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.