मैं एकीकरण परीक्षण के लिए अपने रेल आवेदन के परीक्षण के लिए capybara का उपयोग कर रहा हूँ। मेरे आवेदन में कई लाइटबॉक्स और अजाक्स और जेएस कॉल हैं।कैपिबरा परिदृश्य में प्रतीक्षा स्थिति कैसे जोड़ें?
@javascript
Scenario: I agree functionatilty
Given I go to the create account page
When I click on button which is given as image "lnkTerms2"
And I follow "i_agree"
Then I go to the create account page
ऊपर कोड lnkTerms2 में
यहाँ है और आईडी जो js फ़ंक्शन को कॉल किसी लाइटबॉक्स खोलने के लिए में मदद मिलेगी। और मैं के रूप में
Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotDisplayedError)
[remote server] resource://fxdriver/modules/atoms.js:9519:in `unknown'
[remote server] file:///tmp/webdriver-profile20111117-6876-18cfcfp/extensions/[email protected]/components/nsCommandProcessor.js:256:in `unknown'
[remote server] file:///tmp/webdriver-profile20111117-6876-18cfcfp/extensions/[email protected]/components/nsCommandProcessor.js:305:in `unknown'
[remote server] file:///tmp/webdriver-profile20111117-6876-18cfcfp/extensions/[email protected]/components/nsCommandProcessor.js:320:in `unknown'
[remote server] file:///tmp/webdriver-profile20111117-6876-18cfcfp/extensions/[email protected]/components/nsCommandProcessor.js:197:in `unknown'
(eval):2:in `send'
(eval):2:in `click_link'
./features/step_definitions/web_steps.rb:300:in `/^I click on button which is given as image "([^"]*)"$/'
features/Sign_up_process.feature:61:in `When I click on button which is given as image "lnkTerms2"'
समस्या है इस समारोह webdriver में कहा जाता है के रूप में, यह जावास्क्रिप्ट और ajax कॉल लोड करने के लिए समय हो रही है एक त्रुटि हो रही है। और लाइटबॉक्स नहीं खुल रहा है। तो कृपया मुझे कोई समाधान सुझाएं।
इसके अलावा मान लीजिए अगर मैं लाइन
When I click on button which is given as image "lnkTerms2"
तो 4 से 5 बयान के बाद लिखना यह ठीक काम कर रहा है के रूप में यह js लोड करने के लिए समय हो जाता है।
यह एक अच्छा समाधान नहीं है, यह आपके परीक्षण निष्पादन में मजबूर देरी जोड़ रहा है, अगर इसका पुन: उपयोग किया जाता है तो इसमें बहुत समय लग सकता है। इस समस्या को हल करने का सही तरीका एक तत्व दिखाई देने तक प्रतीक्षा कर रहा है। – Benja
निश्चित नींद का कोई भी रूप, भले ही यह परिदृश्य से मूल्य ले रहा हो, आम तौर पर एक भयानक विचार है, जब तक परिदृश्य वास्तव में उपयोगकर्ता अनुभव के बारे में नहीं है जिसमें उस विशिष्ट समय का इंतजार करना शामिल है (प्रदर्शन के लिए प्रदर्शन की प्रतीक्षा के विपरीत। , उदाहरण के लिए 'सिंकिंग') –