For example, we have:
Get ticket value
Wait Until Element is Visible ${ticketDescription}
${ticketDescValue}= Execute Javascript return window.document.querySelector('p[class*="ticket-description"]').innerHTML.toString()
Verify if ticket value matches
Element Text Should Be ${some_locator} ${ticketDescValue}
where, ${ticketDescValue} would be an expected text
Test Cases example:
*** Test Cases ***
Ticket value is correct
[Documentation] OK: test test test
[Tags] Add to basket
Go to some URL
Get ticket value
Navigate to product details page
Verify if ticket value matches
Is there some way to share variables between existing keywords? In Java I can use getters and setters for this case. Or send parameters to method, etc...
How to implement it using Robot Framework?