Running Selenium Invalid Status code=403 Fix - Eclipse
If running Seleniums Tests in Selenic 2022.2 on Eclipse and encounter the following message:
Chrome version installed: 114.0.5735.99
Chrome driver installed: ChromeDriver 114.0.5735.90
This issue occurs with newer versions of Chrome as discussed here:
Selenium 4.8.3 has a fix for this issue that affects the newer versions of Chrome and will not need to add “--remote-allow-origins=*” to the options, this was done to remedy the issue prior to Selenium 4.8.3.
- This fix is addressed here: https://qaautomation.expert/2023/03/15/selenium-tests-failing-on-chrome-version-111/
Since Parasoft Selenic 2022.2 ships with selenium 4.7.2, a **solution **to this issue is to upgrade the Selenium Java Libraries (.jar files) from https://www.selenium.dev/downloads/ and replace the older Selenium jar files in the project.
At the time of this writing, we have verified selenium java libraries 4.10 worked successfully.
Please note these changes will persist for the project. However, the jar files will be required to remove/replaced again for newly created projects.
Steps to update Selenium Java Libraries in Selenic:
Download the latest Selenium Java libraries (4.10) from https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.10.0/selenium-java-4.10.0.zip
--Can also be found here: https://www.selenium.dev/downloads/
Extract the contents to the machine.
In Eclipse, remove 4.7.2 jars and replace them with the updated 4.10 jar files.
a) In Eclipse’s Package Explorer open Project and right-click “Referenced Libraries” > select “Build Path” > Configure Build Path
b)To remove: ctrl shift select all selenium *4.7.2.jar files then select “Remove”
c)To replace: in the same page scroll up and select "Classpath" > Add External Jars..
d) Navigate to the extracted content (2) and select all selenium *4.10.0.jar files
--Please note: *-source.jar files found in the extracted content (2) are not required and will take up data if added; however, adding will not affect the functionality.
e) Select Apply and Close
All done. Attempt to run tests as before.