Closed lukas-vlcek closed 10 years ago
In the end I prepared a new PR with upgrade to selenium 2.40.0 (the latest one). API changes were minimal. @jlgrock do you think you can have a look at this and merge if you are fine with this?
Oh yeah, these types of changes are definitely fine. No params changed to the end user and it works better. You'll get no complaints here :)
I have started using Selenium 2.41.0 and I am facing issue related to CORS. I have a javascript based site that is served by apache2 which inturn uses webservices served by tomcat server (running in the same machine). When I run selenium to test, I get errors related to CORS.
Error below:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8080/v1//session/. This can be fixed by moving the resource to the same domain or enabling CORS.
But the same test runs perfectly fine when run from selenium plugin in firefox. My cmdline for running the test is as under:
java -jar selenium-server-standalone-2.41.0.jar -htmlSuite *firefox http://localhost/index.html /home/user/web/Automationtestcases/tests/Automationtestcases.html /tmp/test.html
Do I have set any options to get CORS working with selenium? Any pointers on what might be going wrong?
The last comment seems to be unrelated to this plugin, but more in the general usage of selenium server. Please visit the selenium forums for that information, as they will be able to better help you with that stuff.
Currently used version of selenium is dated. We need to upgrade to new version which brings a lot better support of CORS.
I am hitting a use case where I want to call external http rest service from the integration test. This service is started as a part of pre-integration test phase and runs on
localhost
. Currently, when I do something like this in my javascript test:I get:
Note the Access to restricted URI denied message.
It turns out that this is problem of HtmlUnit version 2.9 (which is used by selenium 2.24.1) as it does not support CORS. Better CORS support is available in HtmlUnit version 2.11 and higher. See HtmlUnit changes report.
I tested selenium 2.35.0 which uses HtmlUnit 2.12 and it works well. Upgrading to even newer version of selenium would require adaptation to changed API. But it might be worth too.