From 15782c779568a5db89dedbb86becd04a292e5f19 Mon Sep 17 00:00:00 2001 From: jvelilla Date: Wed, 8 May 2013 10:20:48 -0300 Subject: [PATCH 1/4] Update readme.md --- library/test/selenium/readme.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/library/test/selenium/readme.md b/library/test/selenium/readme.md index 163cc476..cf2ada04 100644 --- a/library/test/selenium/readme.md +++ b/library/test/selenium/readme.md @@ -20,7 +20,8 @@ WARNING this API is still under development, and maybe it will change java -jar selenium-server-standalone-2.32.0.jar -Dwebdriver.chrome.driver=%PATH_TO%\chromedriver.exe -Dwebdriver.ie.driver=%PATH_TO%\IEDriverServer.exe -## Getting Started Selenium-WebDriver API (Eiffel binding only support (for now) RemoteWebDriver) +## Getting Started Selenium-WebDriver API +(Eiffel binding only support (for now) RemoteWebDriver) The examples and guide are based on http://docs.seleniumhq.org/docs/03_webdriver.jsp#introducing-the-selenium-webdriver-api-by-example WebDriver is a tool for automating web application testing, and in particular to verify that they work as expected. @@ -75,12 +76,20 @@ WebDriver is a tool for automating web application testing, and in particular to ### Selenium-WebDriver API Commands and Operations - Fetching a Page - The first thing you’re likely to want to do with WebDriver is navigate to a page. +##### Fetching a Page + The first thing you are likely to want to do with WebDriver is navigate to a page. web_driver.to_url ("http://www.google.com/") - - + +##### Locating UI Elements (WebElements) +###### By ID +Example of how to find an element that looks like this: + + + +Eiffel Code + web_driver.find_element ((create{SE_BY}).id ("head")) + ### Locating Elements From f8f1773d18fc05967529c81f85593457dc27215a Mon Sep 17 00:00:00 2001 From: jvelilla Date: Wed, 8 May 2013 10:21:23 -0300 Subject: [PATCH 2/4] Update readme.md --- library/test/selenium/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/library/test/selenium/readme.md b/library/test/selenium/readme.md index cf2ada04..87f79afb 100644 --- a/library/test/selenium/readme.md +++ b/library/test/selenium/readme.md @@ -88,6 +88,7 @@ Example of how to find an element that looks like this: Eiffel Code + web_driver.find_element ((create{SE_BY}).id ("head")) ### Locating Elements From e5765d356fda6e919e9416e53298dbc1ce67faeb Mon Sep 17 00:00:00 2001 From: jvelilla Date: Wed, 8 May 2013 10:38:25 -0300 Subject: [PATCH 3/4] Updated documentation This documentation is based on Selinum http://docs.seleniumhq.org/ and adapted to the Eiffel implementation. --- library/test/selenium/readme.md | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/library/test/selenium/readme.md b/library/test/selenium/readme.md index 87f79afb..ec0ae389 100644 --- a/library/test/selenium/readme.md +++ b/library/test/selenium/readme.md @@ -91,6 +91,82 @@ Eiffel Code web_driver.find_element ((create{SE_BY}).id ("head")) + +###### By Name + +Example of how to find an element that looks like this: + + + +Eiffel Code + + web_driver.find_element ((create{SE_BY}).name ("cheese")) + +###### By Class Name + +Example of how to find an element that looks like this: + +
Cheddar
Gouda
+ +Eiffel Code + + web_driver.find_element ((create{SE_BY}).class_name ("cheese")) + +###### By CSS Selector + +Example of how to find an element that looks like this: + +
milkcheese
+ +Eiffel Code + + web_driver.find_element ((create{SE_BY}).css_selector ("#food span.dairy.aged")) + +###### By Link Text + +Example of how to find an element that looks like this: + + EWF> + +Eiffel Code + + web_driver.find_element ((create{SE_BY}).link_text ("EWF")) + + +###### By Partial Link Text + +Example of how to find an element that looks like this: + + search for ewf> + +Eiffel Code + + web_driver.find_element ((create{SE_BY}).partial_link_text ("ewf")) + + +###### By Tag Name + +Example of how to find an element that looks like this: + + + +Eiffel Code + + web_driver.find_element ((create{SE_BY}).tag_name ("iframe")) + + +###### By XPath + + +Example of how to find an element that looks like this: + + + +Eiffel Code + + web_driver.find_element ((create{SE_BY}).xpath ("//input")) + + ### Locating Elements From 2d3dadc85e246028fb591eb548e900a58da7142b Mon Sep 17 00:00:00 2001 From: jvelilla Date: Wed, 8 May 2013 10:48:03 -0300 Subject: [PATCH 4/4] Update readme.md --- library/test/selenium/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/library/test/selenium/readme.md b/library/test/selenium/readme.md index ec0ae389..19b30d70 100644 --- a/library/test/selenium/readme.md +++ b/library/test/selenium/readme.md @@ -76,6 +76,7 @@ WebDriver is a tool for automating web application testing, and in particular to ### Selenium-WebDriver API Commands and Operations +To learn more go to [Selenium documentation] (http://docs.seleniumhq.org/docs/03_webdriver.jsp#introducing-the-selenium-webdriver-api-by-example) ##### Fetching a Page The first thing you are likely to want to do with WebDriver is navigate to a page.