Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit a337191

Browse files
committed
Fixed locators in tests
Logging TRACE by default when testing library
1 parent be98678 commit a337191

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
<goal>run</goal>
261261
</goals>
262262
<configuration>
263-
<logLevel>debug</logLevel>
263+
<logLevel>TRACE:INFO</logLevel>
264264
<testCasesDirectory>${project.basedir}/src/test/robotframework/testsuites</testCasesDirectory>
265265
<variables>
266266
<variable>browser:${browser}</variable>

src/test/robotframework/objects/Google.Search.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Documentation Defines all required resources and keywords
44
Resource ../adapters/SeleniumLibrary.txt
55

66
*** Variables ***
7-
${Google.Search.Locator.SearchField} id:lst-ib
7+
${Google.Search.Locator.SearchField} name:q
88
${Google.Search.Locator.SearchResult.Rtomac} xpath://a[contains(.,'MarkusBernhardt')]
99

1010
*** Keywords ***

src/test/robotframework/testsuites/UnitTests/Google.robot

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,17 @@ Search Robotframework Selenium2Library
2020
Google.Search.Search String Robotframework Selenium2Library Java
2121

2222
Search With JavaScript Locator
23-
SeleniumLibrary.Add Location Strategy elementById return window.document.getElementById(arguments[0]);
24-
Input Text elementById:lst-ib Robotframework Selenium2Library Java
25-
Press Key elementById:lst-ib \\13
23+
SeleniumLibrary.Add Location Strategy elementByName return window.document.getElementsByName(arguments[0])[0];
24+
Input Text elementByName:q Robotframework Selenium2Library Java
25+
Press Key elementByName:q \\13
2626
Wait Until Element Is Visible xpath://a[contains(.,'MarkusBernhardt')]
2727
Capture Page Screenshot
28-
29-
Search With JavaScript Locator Text
30-
SeleniumLibrary.Add Location Strategy text return window.document.evaluate("//*[contains(@value,'" + arguments[0] + "')]", window.document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
31-
Wait Until Element Is Visible text:Google
3228

3329
Search Without Locator Type
34-
Input Text lst-ib Robotframework Selenium2Library Java
35-
Press Key lst-ib \\13
30+
Input Text q Robotframework Selenium2Library Java
31+
Press Key q \\13
3632
Wait Until Element Is Visible //a[contains(.,'MarkusBernhardt')]
3733

38-
Get Id Of Active Element With JavaScript
39-
Input Text lst-ib Robotframework Selenium2Library
40-
${activeElementId}= Execute JavaScript return window.document.activeElement.id;
34+
Get Name Of Active Element With JavaScript
35+
Input Text q Robotframework Selenium2Library
36+
${activeElementId}= Execute JavaScript return window.document.activeElement.name;

0 commit comments

Comments
 (0)