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

Commit 47c60db

Browse files
committed
Corrected by review comments - updated constructor issues of CustomRobotDriverElement class
1 parent 562d59f commit 47c60db

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/github/markusbernhardt/seleniumlibrary/CustomRobotDriverElement.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.github.markusbernhardt.seleniumlibrary.keywords.BrowserManagement;
44
import com.github.markusbernhardt.seleniumlibrary.keywords.Robot;
5+
import org.apache.commons.lang3.exception.ExceptionUtils;
56
import org.openqa.selenium.WebDriver;
67

78
import javax.script.ScriptEngine;
@@ -21,12 +22,14 @@ public class CustomRobotDriverElement {
2122
public CustomRobotDriverElement() throws NoSuchFieldException, IllegalAccessException {
2223
try {
2324
CustomRobotDriverElement.s = getLibraryInstance();
24-
} catch (javax.script.ScriptException e) {
25-
throw new SeleniumLibraryNonFatalException("Cannot create SeleniumLibrary instance: " + e.getMessage());
25+
} catch (ScriptException e) {
26+
throw new SeleniumLibraryNonFatalException("Cannot create SeleniumLibrary instance: \n"
27+
+ ExceptionUtils.getStackTrace(e));
2628
}
2729
Field bmField = SeleniumLibrary.class.getDeclaredField("bm");
2830
bmField.setAccessible(true);
2931
b = (BrowserManagement) bmField.get(s);
32+
bmField.setAccessible(false);
3033
}
3134

3235
private static SeleniumLibrary getLibraryInstance() throws ScriptException {

0 commit comments

Comments
 (0)