Sawitree Cha
Sawitree Cha

Reputation: 199

How to verify text but except some text in line using robot framework

I have to verify text that present on web page but in the text line have dynamic wording that I don't know how to verify this situation.

    Wait Until Element Contains    &{verScript}[Script]    Test automate for 50,000 time   timeout=60s

I want to verify text "Test automate for 50,000 time" but 50,000 is dynamic value. I don't want to verify 50,000 in this locator and can it whatever for this value in line.

Can any help me please.

Upvotes: 0

Views: 2247

Answers (1)

Dev
Dev

Reputation: 2813

using set

@{queryResultsA}=    split string     Test automate for 50,000 time
@{queryResultsB}=    split string     Test automate for XX,XXX time

${z} =  Evaluate    (set(${queryResultsA}) - set(${queryResultsB}))

## here ${z} will be 50,000

Using keyword

will return all lines on the page which are matching given string. the following keyword will return Lines as one string concatenated back together with newlines

Get Lines Containing String    Test automate for 

for more keywords

which match partial and full text/strings

using regex and pattern matching

Upvotes: 3

Related Questions