2016-03-11 12 views
5

मुझे Error: no display specified त्रुटि के साथ सामना करना पड़ता है जब फ्रीबीएसडी सर्वर पर जेनकींस में प्ले फ्रेमवर्क परीक्षण चलाते हैं। तो हर बार जब मैं समय समाप्ति के साथ आमनेजेनकिंस के साथ हेनलेस फ़ायरफ़ॉक्स Xvfb चलाना सेलेनियम परीक्षण

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox

जेनकींस है:

1) Xvfb प्लगइन

2) स्थापित फ्रेमवर्क स्थापित

प्ले

टेस्ट selenide पुस्तकालय और selenide का उपयोग कर लिखा जाता है प्ले फ्रेमवर्क के लिए मॉड्यूल।

Xvfb नौकरी कॉन्फ़िगरेशन में कॉन्फ़िगर और सक्षम।

नौकरी कंसोल आउटपुट है:

Checking out Revision 3f485bd2e3dbcfa058fc19f89ab18020e36707d8 (origin/trunk) 
... 
Xvfb starting$ /usr/local/bin//Xvfb :1 -screen 0 -fbdir /usr/local/jenkins/xvfb-9-786185694297443042.fbdir 
... 
Command detected: clean 
Command detected: deps --sync 
Command detected: precompile 
Command detected: auto-test 
[YalsTests] $ /srv/java/play/play clean 
... 
~ using java version "1.8.0_72" 
[YalsTests] $ /srv/java/play/play auto-test 
~ 14 tests to run: 
~ 
~ selenium/front/CorrectInput...   org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: 
Error: no display specified 

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:113) 
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271) 

नौकरी विन्यास:

[X] Start Xvfb before the build, and shut it down after. 
Xvfb specific display name 1 
Xvfb display name offset 0 

Invoke Play Framework  
Command set  Play 1.x 
Goals 
    Clean project [clean] 
    Custom parameter 
     Custom command deps --sync 
    Precompile all Java sources and templates [precompile] 
    Automatically run all application tests [auto-test] 

उत्तर

1

सेलेनियम कार्यों प्रदर्शन है कि यह करने के लिए कनेक्ट करेगा पता करने के लिए की जरूरत है। आप इसे सेट कर सकते हैं उदा।

DISPLAY=:10 
export DISPLAY 

आप: एक वातावरण चर के रूप में

export DISPLAY=:10 

यह बैश के लिए है (इसे निर्यात करने, अगर आपको लगता है कि .profile में क्या मत भूलना), अन्य गोले एक 2 चरण वाली प्रक्रिया की आवश्यकता हो सकती

DISPLAY=:10 java -jar mySelenium.jar 
0

आप Selenoid परियोजना का उपयोग करके इन सभी मुद्दों से बच सकते हैं जोमें समानांतर में बिना सिर ब्राउज़रों शुरू होता है: यह भी आदेश से पहले आदेश पंक्ति पर चर निर्दिष्ट कर सकते हैंकंटेनर। कंटेनर छवियां वेबड्राइवर और ब्राउज़र के संगत संस्करण पर विचार करके बनाई गई हैं। उनमें फोंट, फ्लैशप्लेयर और अन्य भी शामिल हैं। बस पहले से मौजूद images में से एक चुनें और अपने परीक्षण चलाएं। सेलेनियम परीक्षण चलाने के लिए जावा स्थापित करने की आवश्यकता नहीं है।

संबंधित मुद्दे