Skip to content

Commit

Permalink
Merge pull request #291 from thc202/selenium/update-4.28.0
Browse files Browse the repository at this point in the history
Update Selenium to 4.28.0
  • Loading branch information
psiinon authored Jan 21, 2025
2 parents 18fb354 + a2786f6 commit 76d8137
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Changed
- Update Selenium to version 4.26.0.
- Update Selenium to version 4.28.0.

## [0.22.0] - 2024-06-28
### Added
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ dependencies {
implementation (
'org.apache.httpcomponents:httpclient:4.5.8',
'com.google.code.gson:gson:2.8.5',
'org.seleniumhq.selenium:selenium-java:4.26.0',
'org.seleniumhq.selenium:htmlunit3-driver:4.26.0',
'org.seleniumhq.selenium:selenium-java:4.28.0',
'org.seleniumhq.selenium:htmlunit3-driver:4.27.0',
'net.htmlparser.jericho:jericho-html:3.1',
'com.fasterxml.jackson.core:jackson-core:2.15.2',
'com.fasterxml.jackson.core:jackson-databind:2.15.2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
package org.zaproxy.zest.core.v1;

import org.openqa.selenium.WebElement;

/**
* Clear the specified client element.
*
Expand Down Expand Up @@ -53,7 +55,7 @@ public void setAttribute(String attribute) {
public String invoke(ZestRuntime runtime) throws ZestClientFailException {
String val;
if (this.attribute != null && this.attribute.length() > 0) {
val = this.getWebElement(runtime).getAttribute(this.attribute);
val = getAttribute(getWebElement(runtime), attribute);
} else {
val = this.getWebElement(runtime).getText();
}
Expand All @@ -62,6 +64,14 @@ public String invoke(ZestRuntime runtime) throws ZestClientFailException {
return val;
}

private static String getAttribute(WebElement element, String name) {
String value = element.getDomAttribute(name);
if (value != null) {
return value;
}
return element.getDomProperty(name);
}

@Override
public ZestStatement deepCopy() {
ZestClientElementAssign copy =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected ZestLoopTokenStringSet getConvertedSet() throws ZestClientFailExceptio
if (this.attribute == null || this.attribute.length() == 0) {
val = we.getText();
} else {
val = we.getAttribute(attribute);
val = getAttribute(we, attribute);
}

if (val != null && val.length() > 0) {
Expand All @@ -106,6 +106,14 @@ protected ZestLoopTokenStringSet getConvertedSet() throws ZestClientFailExceptio
return convertedSet;
}

private static String getAttribute(WebElement element, String name) {
String value = element.getDomAttribute(name);
if (value != null) {
return value;
}
return element.getDomProperty(name);
}

@Override
public String getToken(int index) {
try {
Expand Down

0 comments on commit 76d8137

Please sign in to comment.