Reputation: 365
I am building some test cases using Jenkins, Spock, IE and Firefox selenium Drivers and Gradle.
The test opens a login page, sets user and password and logs into the application.
The test works propertly for both IE and Firefox when I run it from gradle command prompt, but works only for Firefox and not for IE when I execute the test in Jenkins.
It seems that setting user and password only works in Firefox, on IE they are not set, them are kept empty.
the test is something like:
def "login"() {
when:
to LoginPage
and:
$("#login input[name=user]").value("username")
LOGGER.info "user is " + $("#login input[name=user]").value()
$("#login input[name=pass]").value("password")
LOGGER.info "pass is " + $("#login input[name=pass]").value()
LOGGER.info "Set user and password"
$("#login input[type=button]").click()
then:
at MainPage
}
When running test for IE from Jenkins, I see on trace that user and password are kept empty, but when running test for Firefox from Jenkins, and running test for IE from gradle command line, user and password are set propertly.
Thanks in advance.
Upvotes: 0
Views: 1137
Reputation: 365
It seems that the problem is running Jenkins as a windows service. As can be seen in Selenium InternetExplorerDriver
Running IEDriverServer.exe Under a Windows Service
Attempting to use IEDriverServer.exe as part of a Windows Service application is expressly unsupported. Service processes, and processes spawned by them, have much different requirements than those executing in a regular user context. IEDriverServer.exe is explicitly untested in that environment, and includes Windows API calls that are documented to be prohibited to be used in service processes. While it may be possible to get the IE driver to work while running under a service process, users encountering problems in that environment will need to seek out their own solutions.
ieDriver is not supported under windows service. I executed Jenkins as a windows service so ie tests fell. Then I downloaded Jenkins war and put it on a Tomcat server, and run it from a command prompt, then all test, included ie tests worked propertly.
So the solution is not running Jenkins as a windows service.
Upvotes: 1