Command element

To execute search we have to click on search button

Looking for search button's locator

  • Right click at search button

  • Copy "name"

  • Update code in google.robot

*** Settings ***
Library     Selenium2Library

*** Test cases ***
Search by keywords
    Open browser    http://www.google.com    chrome
    Input text    name=q    thailand
    Click Element    name=btnK
  • Execute and see result
Prayochs-MacBook-Pro:book JackSW$ robot google.robot
==============================================================================
Google
==============================================================================
Search by keywords                                                    | FAIL |
ElementNotVisibleException: Message: element not visible
  (Session info: chrome=71.0.3578.98)
  (Driver info: chromedriver=2.40.565386 (45a059dc425e08165f9a10324bd1380cc13ca363),platform=Mac OS X 10.14.2 x86_64)
------------------------------------------------------------------------------
Google                                                                | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  /Users/JackSW/workspace/workshop/2c2p-robot/book/output.xml
Log:     /Users/JackSW/workspace/workshop/2c2p-robot/book/log.html
Report:  /Users/JackSW/workspace/workshop/2c2p-robot/book/report.html
  • To fix this error message we have to tell robot framework to wait until the button exist.

results matching ""

    No results matching ""