Closed kazurayam closed 2 years ago
https://bonigarcia.dev/webdrivermanager/#known-issues
- Known Issues HTTP response code 403 Some of the drivers (e.g., geckodriver or operadriver) are hosted on GitHub. When external clients (like WebDriverManager) makes many consecutive requests to GitHub, and due to its traffic rate limit, it eventually responds with an HTTP 403 error (forbidden), as follows: ... To avoid this problem, WebDriverManager can make authenticated requests using a personal access token. See the advanced configuration section to discover how to set up this token in WebDriverManager.
... seems this is not the cause of my issue (HTTP response code 401 )
https://github.com/bonigarcia/webdrivermanager/issues/708 this post tells that the reason is too old version of WebDriverManager.
In my project, I am using v5.0.3. Is it too old?
v5.0.3 seems to be the latest one
Firefox version of my Mac is 96.0 (64bit), the latest one
I tried to open the URL https://api.github.com/repos/mozilla/geckodriver/releases manually on browser, then I got a valid JSON response.
So the URL is OK, but WebDriverManager on my Mac could not get it.
I created a new GitHub Personal Access Token. Using it I configured WebDriverManager as follows
@BeforeClass
static void beforeClass() {
// GitHub Personal Access Token
String GHT = 'ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
WebDriverManager.firefoxdriver().gitHubToken(GHT).setup()
}
It ran OK.
Why I got 401 Unauthorized? --- Possibly the Access Token string I used was wrong.
I know I should never write the Access Token inline. I will bring the Access Token out of the code and put it into some KeyStore.
At https://github.com/kazurayam/webdriverfactory/commit/ce219c9a50658e7af20e58614a548dd8176dec8c
FirefoxDriverFactoryTest encountered an error