Skip to content

Commit 449b80e

Browse files
authored
Upgrade to Selenium 4.38.0; add JavaDoc (#312)
1 parent 06511f1 commit 449b80e

File tree

2 files changed

+41
-9
lines changed

2 files changed

+41
-9
lines changed

selenium4Deps.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ sourceSets {
2525
dependencies {
2626
constraints {
2727
api 'com.nordstrom.tools:testng-foundation:5.2.1-j11'
28-
api 'org.seleniumhq.selenium:selenium-grid:4.36.0'
29-
api 'org.seleniumhq.selenium:selenium-support:4.36.0'
30-
api 'org.seleniumhq.selenium:selenium-chrome-driver:4.36.0'
31-
api 'org.seleniumhq.selenium:selenium-edge-driver:4.36.0'
32-
api 'org.seleniumhq.selenium:selenium-firefox-driver:4.36.0'
28+
api 'org.seleniumhq.selenium:selenium-grid:4.38.0'
29+
api 'org.seleniumhq.selenium:selenium-support:4.38.0'
30+
api 'org.seleniumhq.selenium:selenium-chrome-driver:4.38.0'
31+
api 'org.seleniumhq.selenium:selenium-edge-driver:4.38.0'
32+
api 'org.seleniumhq.selenium:selenium-firefox-driver:4.38.0'
3333
api 'org.seleniumhq.selenium:selenium-opera-driver:4.4.0'
34-
api 'org.seleniumhq.selenium:selenium-safari-driver:4.36.0'
35-
api 'com.nordstrom.ui-tools:htmlunit-remote:4.36.1'
36-
api 'org.seleniumhq.selenium:htmlunit3-driver:4.36.1'
37-
api 'org.htmlunit:htmlunit:4.15.0'
34+
api 'org.seleniumhq.selenium:selenium-safari-driver:4.38.0'
35+
api 'com.nordstrom.ui-tools:htmlunit-remote:4.38.0'
36+
api 'org.seleniumhq.selenium:htmlunit3-driver:4.38.0'
37+
api 'org.htmlunit:htmlunit:4.18.0'
3838
api 'com.codeborne:phantomjsdriver:1.5.0'
3939
api 'org.apache.httpcomponents:httpclient:4.5.14'
4040
api 'org.eclipse.jetty:jetty-servlet:9.4.57.v20241219'

src/main/java/com/nordstrom/automation/selenium/examples/IOSPage.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,52 @@ public By locator() {
4040
}
4141
}
4242

43+
/**
44+
* Populate the two addend fields and tap the 'Compute Sum' button.
45+
*
46+
* @param a addend A
47+
* @param b addend B
48+
* @return sum shown by the application
49+
*/
4350
public int computeSum(int a, int b) {
4451
updateIntegerA(a);
4552
updateIntegerB(b);
4653
return computeSum();
4754
}
4855

56+
/**
57+
* Update the value of addend A.
58+
*
59+
* @param a new value
60+
*/
4961
public void updateIntegerA(int a) {
5062
findElement(Using.INTEGER_A).sendKeys(Integer.toString(a));
5163
}
5264

65+
/**
66+
* Update the value of addend B.
67+
*
68+
* @param a new value
69+
*/
5370
public void updateIntegerB(int b) {
5471
findElement(Using.INTEGER_B).sendKeys(Integer.toString(b));
5572
}
5673

74+
/**
75+
* Tap the 'Compute Sum' button.
76+
*
77+
* @return sum shown by the application
78+
*/
5779
public int computeSum() {
5880
findElement(Using.COMPUTE_SUM).click();
5981
return getAnswerAsInt();
6082
}
6183

84+
/**
85+
* Get displayed sum as an integer.
86+
*
87+
* @return displayed sum; 0 if integer conversion fails
88+
*/
6289
public int getAnswerAsInt() {
6390
try {
6491
return Integer.parseInt(getAnswerAsString());
@@ -67,6 +94,11 @@ public int getAnswerAsInt() {
6794
}
6895
}
6996

97+
/**
98+
* Get displayed sum as a string.
99+
*
100+
* @return displayed sum as a string
101+
*/
70102
public String getAnswerAsString() {
71103
return findElement(Using.ANSWER).getText();
72104
}

0 commit comments

Comments
 (0)