Skip to content

Instantly share code, notes, and snippets.

@bigprof
Created February 20, 2019 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigprof/b609bd8a2a5a698afcc894b77976565c to your computer and use it in GitHub Desktop.
Save bigprof/b609bd8a2a5a698afcc894b77976565c to your computer and use it in GitHub Desktop.
Sample Robot Framework script for checking if a certain site appears in the first results page when searching Google for specific keywords.
*** Settings ***
Library Selenium2Library
Suite Setup start browser
Suite Teardown end browser
*** Variables ***
${browser} = ff
*** Keywords ***
start browser
Open Browser about:blank ${browser}
Maximize Browser Window
Go To https://google.com
Click link English
end browser
Close All Browsers
*** Test Cases ***
Google should return our website when searching for php
Go To https://google.com
Input text q PHP
Press key name=q \\13
Wait Until Page Contains php.net
Capture page screenshot
Google should return our website when searching for file_get_contents
Go To https://google.com
Input text q file_get_contents
Press key name=q \\13
Wait Until Page Contains php.net
Capture page screenshot
Google should return our website when searching for mysqli_connect
Go To https://google.com
Input text q mysqli_connect
Press key name=q \\13
Wait Until Page Contains php.net
Capture page screenshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment