We're currently using the very lovely Robot Framework for our automation.

Unfortunately, we've run into a hitch with the '=' character - we have a number of places in the app where we have a link to click, and no other options for identifying that element. Unfortunately, the links generally have a query string that includes the '=' character, e.g.:

   ClickLink   href=https://foo.bar.com/admin_login.php?action=logoff&clients_id=mytestaccount.foo.bar.com

Because Watir-Robot is able to match on multiple html tags, when Robot parses the above string to Watir-Robot it is using the "=" as a seperator. Watir-Robot sees the above as...

   id=logoff&clients_id (if no tag is stated it will default to id)

hence not matching on any of them.

As workarounds, we've tried the following with no success:

  • Robot's built-in escape character, "\"
  • Wrapping the string in "" or ''
  • Replacing the "=" with the relevant html escape character "="
  • Creating the variable ${EQUALS} containing "=" (without quotes), this had the same results as leaving them in in the first place (as variables are rectified BEFORE they are parsed)

What's the best way of resolving this issue?

  • Note: I've actually also asked this on the Robot mailing list, if I get an answer there I'll add it here.
    – testerab
    Jun 3, 2011 at 10:13
  • I don't know if there is a robot framework tag on the main StackOverflow site, but this might be better off being asked there. I know for Watir help posting to SO is preferred as more Watir folks monitor it than here. Not sure if the same is true of Robot Framework as well or not. Jun 6, 2011 at 7:11

2 Answers 2

${NeededString}=    Fetch From Right    ${FullStringWithEQUALSSign}    \=
Print    ${NeededString}

This will fetch the string to the right of the equals sign. Assumption here that there is only one Equals sign in the string.

Can also use "Split String From Right" keyword?


testerab, you mentioned escaping the equals sign with the relevant HTML escape character. There are two kinds of encoding for special characters in HTML: entity notation and URL Encoding. In entity notation, an equals sign would be


In URL encoding, an equal sign would be


For your problem, the appropriate encoding would be URL encoding. If you haven't already, please give that a try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.