How to add and enable in selenium
vishalbiradar opened this issue · 2 comments
vishalbiradar commented
I am trying to add the cors-everywhere-firefox in firefox from my selenium test code.
But failed to show the addon and even failed to execute the test cases.
My REST APIs are CORS enabled, so I need to add the cors-everywhere-firefox addon.
System.setProperty("webdriver.gecko.driver", "geckodriver");
File file = new File("cors-everywher.xpi");
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.addExtension(file);
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setProfile(firefoxProfile);
WebDriver driver = new FirefoxDriver(firefoxOptions);
I am still getting the below error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
remote resource at http://localhost:5004/v2/ddn/auth/login.
(Reason: CORS request did not succeed).
Please help me.
spenibus commented
Honestly, that sounds more like a question you should direct to the selenium community. I've never used it and don't really have time to set up a test for it. You would get a better and faster response from people who regularly use it.
That being said, if you manage to put the addon in your test profile, remember that it is not activated by default.
vishalbiradar commented
@spenibus
Thanks