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

Commit 239cb42

Browse files
committed
Fixes #88
1 parent 4a911cb commit 239cb42

File tree

6 files changed

+49
-10
lines changed

6 files changed

+49
-10
lines changed

src/main/java/com/github/markusbernhardt/seleniumlibrary/keywords/BrowserManagement.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public String getRemoteCapabilities() {
319319
// Null returned from jbrowserdriver
320320
if (getCurrentWebDriver() instanceof RemoteWebDriver
321321
&& ((RemoteWebDriver) getCurrentWebDriver()).getCapabilities() != null) {
322-
logging.info(getCurrentWebDriver());
322+
logging.info(getCurrentWebDriver().toString());
323323
return ((RemoteWebDriver) getCurrentWebDriver()).getCapabilities().toString();
324324
} else {
325325
return "No remote session id or capabilities available";

src/main/java/com/github/markusbernhardt/seleniumlibrary/keywords/Logging.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ protected void error(String msg) {
198198
protected void log(String msg, String logLevel) {
199199
String[] methodParameters = VALID_LOG_LEVELS.get(logLevel.toLowerCase());
200200
if (methodParameters != null) {
201-
System.out.println(String.format("*%s* %s", logLevel.toUpperCase(), msg));
201+
System.out.printf("*%s* %s%n", logLevel.toUpperCase(), msg);
202202
} else {
203203
throw new SeleniumLibraryNonFatalException(String.format("Given log level %s is invalid.", logLevel));
204204
}

src/main/java/com/github/markusbernhardt/seleniumlibrary/locators/TableElementFinder.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ public class TableElementFinder {
1414
addLocatorSuffix(locatorSuffixesMap, "css.default", "");
1515
addLocatorSuffix(locatorSuffixesMap, "css.content", "");
1616
addLocatorSuffix(locatorSuffixesMap, "css.header", " th");
17-
addLocatorSuffix(locatorSuffixesMap, "css.footer", " tfoot td");
17+
addLocatorSuffix(locatorSuffixesMap, "css.footer", " tfoot td", " tfoot th");
1818
addLocatorSuffix(locatorSuffixesMap, "css.row", " tr:nth-child(%s)");
1919
addLocatorSuffix(locatorSuffixesMap, "css.col", " tr td:nth-child(%s)", " tr th:nth-child(%s)");
2020

2121
addLocatorSuffix(locatorSuffixesMap, "sizzle.default", "");
2222
addLocatorSuffix(locatorSuffixesMap, "sizzle.content", "");
2323
addLocatorSuffix(locatorSuffixesMap, "sizzle.header", " th");
24-
addLocatorSuffix(locatorSuffixesMap, "sizzle.footer", " tfoot td");
24+
addLocatorSuffix(locatorSuffixesMap, "sizzle.footer", " tfoot td", " tfoot th");
2525
addLocatorSuffix(locatorSuffixesMap, "sizzle.row", " tr:nth-child(%s)");
2626
addLocatorSuffix(locatorSuffixesMap, "sizzle.col", " tr td:nth-child(%s)", " tr th:nth-child(%s)");
2727

2828
addLocatorSuffix(locatorSuffixesMap, "xpath.default", "");
2929
addLocatorSuffix(locatorSuffixesMap, "xpath.content", "//*");
3030
addLocatorSuffix(locatorSuffixesMap, "xpath.header", "//th");
31-
addLocatorSuffix(locatorSuffixesMap, "xpath.footer", "//tfoot//td");
31+
addLocatorSuffix(locatorSuffixesMap, "xpath.footer", "//tfoot//td", "//tfoot//th");
3232
addLocatorSuffix(locatorSuffixesMap, "xpath.row", "//tr[%s]//*");
3333
addLocatorSuffix(locatorSuffixesMap, "xpath.col", "//tr//*[self::td or self::th][%s]");
3434
}
@@ -50,6 +50,7 @@ public static WebElement findByHeader(WebDriver webDriver, String tableLocator,
5050

5151
public static WebElement findByFooter(WebDriver webDriver, String tableLocator, String content) {
5252
List<String> locators = parseTableLocator(tableLocator, "footer");
53+
System.out.println(Arrays.toString(locators.toArray()));
5354
return searchInLocators(webDriver, locators, content);
5455
}
5556

src/test/resources/tabletest.html

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<html lang="en">
2+
<head>
3+
<meta charset="utf-8">
4+
<title>Table test</title>
5+
</head>
6+
7+
<body>
8+
<div class="table">
9+
<table id="test_table">
10+
<thead>
11+
<tr>
12+
<th>Items</th>
13+
<th scope="col">Expenditure</th>
14+
</tr>
15+
</thead>
16+
<tbody>
17+
<tr>
18+
<th scope="row">Donuts</th>
19+
<td>3,000</td>
20+
</tr>
21+
<tr>
22+
<th scope="row">Stationery</th>
23+
<td>18,000</td>
24+
</tr>
25+
</tbody>
26+
<tfoot>
27+
<tr>
28+
<th scope="row">Totals</th>
29+
<td>21,000</td>
30+
</tr>
31+
</tfoot>
32+
</table>
33+
</div>
34+
</body>
35+
</html>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*** Settings ***
22
Suite Teardown Close All Browsers
33
Resource ../../settings/Settings.robot
4-
Default Tags htmlunitwith htmlunitwithjs
4+
Default Tags htmlunit htmlunitwithjs
55

66
*** Variables ***
77
${URL Application} http://www.w3schools.com

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
Suite Teardown Close All Browsers
33
Resource ../../settings/Settings.robot
44

5-
*** Variables ***
6-
${URL Application} http://www.w3schools.com
7-
85
*** Test Cases ***
96
Check Form
107
Open Browser file:///${testHTMLDirectory}/formtest.html ${browser}
118
Textfield Value Should Be name:firstname Mickey
12-
Textfield Value Should Be name:homepage http://example.com
9+
Textfield Value Should Be name:homepage http://example.com
10+
11+
Check Table
12+
Open Browser file:///${testHTMLDirectory}/tabletest.html ${browser}
13+
Table Footer Should Contain test_table Totals
14+
Table Footer Should Contain test_table 21,000
15+
Table Header Should Contain test_table Items

0 commit comments

Comments
 (0)