Why i am not able to capture screen shot of selectbox items using selenium-python?
<p>I have a select box on my page. I click on it to expand it and all values are displayed. Now i take screenshot, but in screenshot, select box is not expanded. Please check.</p>

<p>Code:</p>

<pre><code>import unittest
from selenium import webdriver
import datetime
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium.common.exceptions import NoSuchElementException
from unittest import TestCase
import re
import time
import autoit

url="https://www.facebook.com"

class SprintTests(unittest.TestCase):

    def setUp(self):
        self.verificationErrors = []
        self.driver = webdriver.Firefox()
        self.driver.implicitly_wait(30)
        self.driver.maximize_window()
        self.driver.get(url)

    def test_offer_1(self):
        a=self.driver.find_element_by_id("day")
        a.click()
        time.sleep(5)
        self.driver.save_screenshot("res.jpg")


    def tearDown(self):
        self.driver.quit()

if __name__ == '__main__':
    unittest.main(verbosity=2)
</code></pre>

<p>Image generated by my code:
<a href="http://i.stack.imgur.com/da5Wq.png" rel="nofollow"><img src="http://i.stack.imgur.com/da5Wq.png" alt="enter image description here"></a></p>

<p>Expected Image:
<a href="http://i.stack.imgur.com/5g6rU.png" rel="nofollow"><img src="http://i.stack.imgur.com/5g6rU.png" alt="enter image description here"></a></p>

<p>With the given situation, it is expected to behave in this way.
When you perform save_screenshot on driver object, the driver object is now busy getting the screenshot for you instead of keeping the select menu open.
One possible solution is that you launch the save_screenshot method in different thread.</p>

python selenium