How to Run Selenium Script With Jenkins through Git

622 views
Skip to first unread message

dhrumil shah

unread,
Nov 24, 2015, 6:40:29 AM11/24/15
to Jenkins Users
Hello,

When I run my Selenium Webdriver Simple Login script on jenkins through Git then it always skip my test cases and give me the below error.

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
   [testng] No protocol specified
   [testng] No protocol specified
   [testng] Error: cannot open display: :0
   [testng] No protocol specified
   [testng] No protocol specified
   [testng] Error: cannot open display: :0
   [testng]
   [testng]     at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
   [testng]     at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
   [testng]     at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
   [testng]     at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
   [testng]     at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
   [testng]     at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
   [testng]     at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
   [testng]     at Test.TestA.setUpTest(Unknown Source)
   [testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   [testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [testng]     at java.lang.reflect.Method.invoke(Method.java:606)
   [testng]     at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
   [testng]     at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
   [testng]     at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
   [testng]     at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
   [testng]     at org.testng.TestRunner.beforeRun(TestRunner.java:641)
   [testng]     at org.testng.TestRunner.run(TestRunner.java:609)
   [testng]     at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
   [testng]     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
   [testng]     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
   [testng]     at org.testng.SuiteRunner.run(SuiteRunner.java:240)
   [testng]     at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
   [testng]     at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
   [testng]     at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
   [testng]     at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
   [testng]     at org.testng.TestNG.run(TestNG.java:1057)
   [testng]     at org.testng.TestNG.privateMain(TestNG.java:1364)
   [testng]     at org.testng.TestNG.main(TestNG.java:1333)
   [testng]
   [testng] ===============================================
   [testng] Sample Test Suite
   [testng] Total tests run: 1, Failures: 0, Skips: 1
   [testng] Configuration Failures: 1, Skips: 1
   [testng] ===============================================
   [testng]
   [testng] The tests failed.



I have Searched a lot on Internet and some one told that upgrade the version of firefox and upgrade your jar file. But after upgrade my firefox version(42..0) and also the jar file (selenium-2.48.jar). but still get the same issue.

After that I Connect through the putty and run the command 'firefox&' but it gives error like 'can not open display' and also tried with x11 forward but it doesn't work.

Any Help would be appreciated.
Thanks

Mark Waite

unread,
Nov 24, 2015, 6:47:42 AM11/24/15
to Jenkins Users
I think you may be trying to run your tests on a Unix variant (Linux, FreeBSD, Solaris, etc.) but don't have an X Windows server to which the firefox program can connect for displaying itself.

If that's the case, then you should investigate either the Xvnc plugin or the Xvfb plugin.  They both provide simple ways for Jenkins to start and stop an X Windows server which can be used by tests running as part of the job.

If you're running on Windows, then the Jenkins slave needs to be allowed to interact with the desktop.  You can either do that the simple way by running the Jenkins slave from the desktop, or you if you must run your Jenkins slave as a service, then you need to grant your service access to the desktop.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c675d5d2-38bd-4d03-ae40-3d0534050e3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dhrumil shah

unread,
Nov 24, 2015, 7:30:16 AM11/24/15
to Jenkins Users
First of all thanks for your reply.

yes here I am runnig my tests on Linux. and as per you say i have installed xvfb plugin but still got below error:
Here I have attached screen shot of XVfb configuration.

Total time: 47 seconds
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "Xvfb": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
	at hudson.Proc$LocalProc.<init>(Proc.java:244)
	at hudson.Proc$LocalProc.<init>(Proc.java:216)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
	at hudson.Launcher$ProcStarter.start(Launcher.java:382)
	at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.launchXvfb(XvfbBuildWrapper.java:557)
	at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.setUp(XvfbBuildWrapper.java:622)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:653)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
	at hudson.model.Run.execute(Run.java:1741)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:381)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
	at java.lang.ProcessImpl.start(ProcessImpl.java:130)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
	... 12 more
Finished: FAILURE



Capture.PNG

Mark Waite

unread,
Nov 24, 2015, 7:38:33 AM11/24/15
to Jenkins Users
That says you need to install the Xfvb program on your Linux system.  Installing a package depends on the Linux variant, since there are several different package managers.


Refer to your specific operating system for package management for it.

Mark Waite

dhrumil shah

unread,
Nov 24, 2015, 8:15:13 AM11/24/15
to Jenkins Users
Hi,

Thanks again for your reply,
I have installed xvfb plugin in my linux system and made all configuration and tested but get below errors.

testng-execution:
    [mkdir] Created dir: /var/Zeetv_Script/Test-Report/TestNGreport
   [testng] [TestNG] Running:
   [testng]   /var/Zeetv_Script/testng.xml
   [testng] 
   [testng] 
   [testng] ===============================================
   [testng] Sample Test Suite
   [testng] Total tests run: 1, Failures: 0, Skips: 1
   [testng] Configuration Failures: 1, Skips: 1
   [testng] ===============================================
   [testng] 
   [testng] org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
   [testng] No protocol specified
   [testng] No protocol specified
   [testng] Error: cannot open display: :0
   [testng] 
   [testng] ** (firefox:6551): WARNING **: Command line `dbus-launch --autolaunch=6bd658d85852ea4984b47d4c00000008 --binary-syntax --close-stderr' exited with non-zero exit status 1: No protocol specified\nNo protocol specified\nAutolaunch error: X11 initialization failed.\n
   [testng] No protocol specified
   [testng] No protocol specified
   [testng] Error: cannot open display: :0
   [testng] 
   [testng] 	at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
   [testng] 	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
   [testng] 	at Test.TestA.setUpTest(Unknown Source)
   [testng] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [testng] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   [testng] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [testng] 	at java.lang.reflect.Method.invoke(Method.java:606)
   [testng] 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
   [testng] 	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
   [testng] 	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
   [testng] 	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
   [testng] 	at org.testng.TestRunner.beforeRun(TestRunner.java:641)
   [testng] 	at org.testng.TestRunner.run(TestRunner.java:609)
   [testng] 	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
   [testng] 	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
   [testng] 	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
   [testng] 	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
   [testng] 	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
   [testng] 	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
   [testng] 	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
   [testng] 	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
   [testng] 	at org.testng.TestNG.run(TestNG.java:1057)
   [testng] 	at org.testng.TestNG.privateMain(TestNG.java:1364)
   [testng] 	at org.testng.TestNG.main(TestNG.java:1333)
   [testng] The tests failed.

Mark Waite

unread,
Nov 24, 2015, 8:22:25 AM11/24/15
to Jenkins Users
Unfortunately, you're now beyond my expertise.  I'm aware of the Xfvb plugin and heavily used the Xvnc plugin a few years ago.

Mark Waite

dhrumil shah

unread,
Nov 24, 2015, 8:25:30 AM11/24/15
to Jenkins Users
Its Ok...Thanks for your help.

dhrumil shah

unread,
Nov 25, 2015, 12:33:42 AM11/25/15
to Jenkins Users
Hello Mark,

Today I have done another time as per your way and my test run successfully.
So thank you very much for your valuable time. 

dhrumil shah

unread,
Nov 25, 2015, 8:12:28 AM11/25/15
to Jenkins Users
Hello Mark,

Have you used skype? If yes then can you give me your skype id?
If in future any problem regarding this then Can we contact directly on skype?

Mark Waite

unread,
Nov 25, 2015, 9:18:20 AM11/25/15
to Jenkins Users
I have a Skype account but rarely use it.  Asking questions to the Jenkins user list is usually much better than contacting me directly, since there are many subscribers to the Jenkins users list with Jenkins experience.

It is somewhat akin to the same problem we sometimes see with bug reports.  Some people submit a question as a bug report instead of sending the question to the users mailing list.  That then limits the number of people who see the question to only those few people who monitor the specific bug queue, instead of the much larger group that reads the jenkins users mailing list.

Mark Waite

dhrumil shah

unread,
Nov 26, 2015, 12:12:48 AM11/26/15
to Jenkins Users
Its ok Mark

Thanks

dhrumil shah

unread,
Dec 3, 2015, 8:04:52 AM12/3/15
to Jenkins Users
Email.PNG

Dirk Heinrichs

unread,
Dec 3, 2015, 8:19:36 AM12/3/15
to jenkins...@googlegroups.com
Am 03.12.2015 um 14:04 schrieb dhrumil shah:

I have tried with number of ways but it gives error. Here I have attached screenshot of my configuration. So can you please check
and update me what was the issue here.

Guess you need to check "Use SSL".

HTH...

    Dirk

PS: Please start new threads for new topics.
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

dhrumil shah

unread,
Dec 3, 2015, 8:24:28 AM12/3/15
to Jenkins Users, dirk.he...@recommind.com
Hello Dirk,

I have already done with that. but still got error like below

Total time: 0 seconds
Sending e-mails to: dhrumi...@attuneww.com
ERROR: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvNu
534-5.7.14 I6hJ1YxeHWnRBhXXm7SKcIPRSjrd076wguNWiitc3gjR7zXONVMn_s0vAQlQOHhtRiPZfJ
534-5.7.14 d99B_1RyUzDX_N76DWban2v107flWnHV5HfrhxlTfl9TWUb1DkewOYzKNNkgei5I1vNaMj
534-5.7.14 M5KpJACjz2ZdWewlqP3KzGjLF83kCanBfS18tkbzXAzsNHb2q_5S723Jw3vQPhfO4WjvZo
534-5.7.14 Off0hglMFM6jNPcyus7Qa15sKMEA> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14  Learn more at
534 5.7.14  https://support.google.com/mail/answer/78754 w23sm10848158pfi.96 - gsmtp

javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvNu
534-5.7.14 I6hJ1YxeHWnRBhXXm7SKcIPRSjrd076wguNWiitc3gjR7zXONVMn_s0vAQlQOHhtRiPZfJ
534-5.7.14 d99B_1RyUzDX_N76DWban2v107flWnHV5HfrhxlTfl9TWUb1DkewOYzKNNkgei5I1vNaMj
534-5.7.14 M5KpJACjz2ZdWewlqP3KzGjLF83kCanBfS18tkbzXAzsNHb2q_5S723Jw3vQPhfO4WjvZo
534-5.7.14 Off0hglMFM6jNPcyus7Qa15sKMEA> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14  Learn more at
534 5.7.14  https://support.google.com/mail/answer/78754 w23sm10848158pfi.96 - gsmtp

	at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:809)
	at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:752)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:669)
	at javax.mail.Service.connect(Service.java:317)
	at javax.mail.Service.connect(Service.java:176)
	at javax.mail.Service.connect(Service.java:125)
	at javax.mail.Transport.send0(Transport.java:194)
	at javax.mail.Transport.send(Transport.java:124)
	at hudson.tasks.MailSender.execute(MailSender.java:121)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1055)
	at hudson.model.Run.execute(Run.java:1788)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:381)
Finished: FAILURE

Dirk Heinrichs

unread,
Dec 3, 2015, 8:31:56 AM12/3/15
to dhrumil shah, Jenkins Users
Am 03.12.2015 um 14:24 schrieb dhrumil shah:

I have already done with that. but still got error like below

Well, it tells you what to do:

Please log in via your web browser and then try again. Learn more at https://support.google.com/mail/answer/78754

Did you try that, too?

Bye...

    Dirk

dhrumil shah

unread,
Dec 3, 2015, 8:43:44 AM12/3/15
to Jenkins Users, dhrumi...@attuneww.com, dirk.he...@recommind.com
Hello Dirk,

Yes I have tried with login on my account from browser too. and also restart the jenkins. But still got the same issue.

Richard Bywater

unread,
Dec 3, 2015, 3:19:06 PM12/3/15
to Jenkins Users, dirk.he...@recommind.com
Do you have 2-step authentication turned on? If so, as per the linked support page, you'll need to create an app password specific to Jenkins.

Richard.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

dhrumil shah

unread,
Dec 4, 2015, 12:42:44 AM12/4/15
to Jenkins Users, dirk.he...@recommind.com
Yes Richard I have turn on authentication and now its working.
So thank you very much for your suggestion.

Richard Bywater

unread,
Dec 4, 2015, 1:01:03 AM12/4/15
to Jenkins Users, dirk.he...@recommind.com

No problem. It would be nice for the SMTP message to be a bit clearer!

Richard.


Reply all
Reply to author
Forward
0 new messages