selenium-webdriver 4.8.1 → 4.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGES.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## v4.8.2
2
+
3
+ #### :nail_care: Polish
4
+
5
+ * Add CDP support for v111 and remove v108
6
+ * Using json output with Selenium Manager
7
+
8
+ #### :bug: Bug Fix
9
+
10
+ fix: Using status from response (#11742)
11
+
1
12
  ## v4.8.1
2
13
 
3
14
  #### :rocket: New Feature
Binary file
Binary file
Binary file
package/chrome.js CHANGED
@@ -160,10 +160,6 @@ class ServiceBuilder extends chromium.ServiceBuilder {
160
160
  let exe = opt_exe || locateSynchronously()
161
161
 
162
162
  if (!exe) {
163
- console.log(
164
- ` The ChromeDriver could not be found on the current PATH, trying Selenium Manager`
165
- )
166
-
167
163
  try {
168
164
  exe = driverLocation(Browser.CHROME)
169
165
  } catch (err) {
@@ -173,10 +169,9 @@ class ServiceBuilder extends chromium.ServiceBuilder {
173
169
 
174
170
  if (!exe) {
175
171
  throw Error(
176
- `The ChromeDriver could not be found on the current PATH.
177
- Please download the latest version of the ChromeDriver
178
- from http://chromedriver.storage.googleapis.com/index.html
179
- and ensure it can be found on your PATH.`
172
+ `ChromeDriver could not be found on the PATH.
173
+ For more information on how to install drivers see
174
+ https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/.`
180
175
  )
181
176
  }
182
177
 
@@ -69,22 +69,30 @@ function driverLocation(browser) {
69
69
  )
70
70
  }
71
71
 
72
- let args = [getBinary(), '--browser', browser]
73
- let result
72
+ let args = [getBinary(), '--browser', browser, '--output', 'json']
73
+ let output
74
74
 
75
75
  try {
76
- result = execSync(args.join(' ')).toString()
76
+ output = JSON.parse(execSync(args.join(' ')).toString())
77
77
  } catch (e) {
78
+ let error
79
+ try {
80
+ error = JSON.parse(e.stdout.toString()).result.message
81
+ } catch (e) {
82
+ error = e.toString()
83
+ }
78
84
  throw new Error(
79
- `Error executing command with ${args}\n${e.stdout.toString()}${e.stderr.toString()}`
85
+ `Error executing command with ${args}: ${error}`
80
86
  )
81
87
  }
82
88
 
83
- if (!result.startsWith('INFO\t')) {
84
- throw new Error(`Unsuccessful command executed: ${args}\n${result}`)
89
+ for (const key in output.logs){
90
+ if (output.logs[key].level === 'WARN') {
91
+ console.warn(`${output.logs[key].message}`)
92
+ }
85
93
  }
86
94
 
87
- return result.replace('INFO\t', '').trim()
95
+ return output.result.message
88
96
  }
89
97
 
90
98
  // PUBLIC API
package/edge.js CHANGED
@@ -109,10 +109,6 @@ class ServiceBuilder extends chromium.ServiceBuilder {
109
109
  let exe = opt_exe || locateSynchronously()
110
110
 
111
111
  if (!exe) {
112
- console.log(
113
- `The WebDriver for Edge could not be found on the current PATH, trying Selenium Manager`
114
- )
115
-
116
112
  try {
117
113
  exe = driverLocation('edge')
118
114
  } catch (err) {
@@ -122,13 +118,11 @@ class ServiceBuilder extends chromium.ServiceBuilder {
122
118
 
123
119
  if (!exe) {
124
120
  throw Error(
125
- `The WebDriver for Edge could not be found on the current PATH. Please download the ` +
126
- `latest version of ${EDGEDRIVER_CHROMIUM_EXE} from ` +
127
- `https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ ` +
128
- `and ensure it can be found on your PATH.`
121
+ `MSEdgeDriver could not be found on the PATH.
122
+ For more information on how to install drivers see
123
+ https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/.`
129
124
  )
130
125
  }
131
-
132
126
  super(exe)
133
127
  this.setLoopback(true)
134
128
  }
package/firefox.js CHANGED
@@ -474,10 +474,6 @@ function findGeckoDriver() {
474
474
  let exe = locateSynchronously()
475
475
 
476
476
  if (!exe) {
477
- console.log(
478
- `The ${GECKO_DRIVER_EXE} executable could not be found on the current PATH, trying Selenium Manager`
479
- )
480
-
481
477
  try {
482
478
  exe = driverLocation(Browser.FIREFOX)
483
479
  } catch (err) {
@@ -487,9 +483,9 @@ function findGeckoDriver() {
487
483
 
488
484
  if (!exe) {
489
485
  throw Error(
490
- `The ${GECKO_DRIVER_EXE} executable could not be found on the current PATH.
491
- Please download the latest version from https://github.com/mozilla/geckodriver/releases/
492
- and ensure it can be found on your PATH.`
486
+ `GeckoDriver could not be found on the PATH.
487
+ For more information on how to install drivers see
488
+ https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/.`
493
489
  )
494
490
  }
495
491
 
package/ie.js CHANGED
@@ -401,10 +401,6 @@ function createServiceFromCapabilities(capabilities) {
401
401
 
402
402
  let exe = locateSynchronously()
403
403
  if (!exe) {
404
- console.log(
405
- `The ${IEDRIVER_EXE} executable could not be found on the current PATH, trying Selenium Manager`
406
- )
407
-
408
404
  try {
409
405
  exe = driverLocation('iexplorer')
410
406
  } catch (err) {
@@ -414,10 +410,9 @@ function createServiceFromCapabilities(capabilities) {
414
410
 
415
411
  if (!exe || !fs.existsSync(exe)) {
416
412
  throw Error(
417
- `${IEDRIVER_EXE} could not be found on the current PATH. Please ` +
418
- `download the latest version of ${IEDRIVER_EXE} from ` +
419
- 'https://www.selenium.dev/downloads/ and ' +
420
- 'ensure it can be found on your system PATH.'
413
+ `IEDriver could not be found on the PATH.
414
+ For more information on how to install drivers see
415
+ https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/.`
421
416
  )
422
417
  }
423
418
 
package/lib/webdriver.js CHANGED
@@ -1405,7 +1405,7 @@ class WebDriver {
1405
1405
  if (requestPausedParams.request.url == httpResponse.urlToIntercept) {
1406
1406
  connection.execute('Fetch.fulfillRequest', {
1407
1407
  requestId: requestPausedParams['requestId'],
1408
- responseCode: 200,
1408
+ responseCode: httpResponse.status,
1409
1409
  responseHeaders: httpResponse.headers,
1410
1410
  body: httpResponse.body,
1411
1411
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "selenium-webdriver",
3
- "version": "4.8.1",
3
+ "version": "4.8.2",
4
4
  "description": "The official WebDriver JavaScript bindings from the Selenium project",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [