@@ -149,6 +149,35 @@ public class HtmlUnitDriver implements WebDriver, JavascriptExecutor,
149
149
public static final String INVALIDSELECTIONERROR =
150
150
"The xpath expression '%s' selected an object of type '%s' instead of a WebElement" ;
151
151
152
+ /**
153
+ * Constructs a new instance with JavaScript disabled,
154
+ * and the {@link BrowserVersion#getDefault() default} BrowserVersion.
155
+ */
156
+ public HtmlUnitDriver () {
157
+ this (false );
158
+ }
159
+
160
+ /**
161
+ * Constructs a new instance, specify JavaScript support
162
+ * and using the {@link BrowserVersion#getDefault() default} BrowserVersion.
163
+ *
164
+ * @param enableJavascript whether to enable JavaScript support or not
165
+ */
166
+ public HtmlUnitDriver (boolean enableJavascript ) {
167
+ this (BrowserVersion .getDefault (), enableJavascript );
168
+ }
169
+
170
+ /**
171
+ * Constructs a new instance with the specified {@link BrowserVersion} and the JavaScript support.
172
+ *
173
+ * @param version the browser version to use
174
+ * @param enableJavascript whether to enable JavaScript support or not
175
+ */
176
+ public HtmlUnitDriver (BrowserVersion version , boolean enableJavascript ) {
177
+ this (version );
178
+ setJavascriptEnabled (enableJavascript );
179
+ }
180
+
152
181
/**
153
182
* Constructs a new instance with the specified {@link BrowserVersion}.
154
183
*
@@ -197,25 +226,6 @@ public void webWindowClosed(WebWindowEvent event) {
197
226
resetKeyboardAndMouseState ();
198
227
}
199
228
200
- /**
201
- * Constructs a new instance with JavaScript disabled,
202
- * and the {@link BrowserVersion#getDefault() default} BrowserVersion.
203
- */
204
- public HtmlUnitDriver () {
205
- this (false );
206
- }
207
-
208
- /**
209
- * Constructs a new instance, specify JavaScript support
210
- * and using the {@link BrowserVersion#getDefault() default} BrowserVersion.
211
- *
212
- * @param enableJavascript whether to enable JavaScript support or not
213
- */
214
- public HtmlUnitDriver (boolean enableJavascript ) {
215
- this (BrowserVersion .getDefault ());
216
- setJavascriptEnabled (enableJavascript );
217
- }
218
-
219
229
/**
220
230
* Note: There are two configuration modes for the HtmlUnitDriver using this constructor.
221
231
* <ol>
0 commit comments