79394317

Date: 2025-01-28 15:23:28
Score: 1
Natty:
Report link

I suppose the HTML file is something like the one below:

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
</head>
<body>
    <code id="user-code">SRQX-FJXQ</code>
</body>
</html>

And you want to get SRQX-FJXQ. Here is the Robot code:

*** Test Cases ***
Get Code
    Open Browser    ${path_to_your_html}    chrome
    ${code}=    Get Text    xpath=//*[@id="user-code"]
    Log To Console   User code value: ${code}
    Close Browser

Here is the result:

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Mohsen Khosroanjam