so I was trying to debug the tests we have running django/phantomjs/selenium-webdrive with ipdb, but the interactive debugger input was too slow, I need to hold a key for 3-5 seconds to get that character written down.
so I tracked it down and find out it was happening right after initiating phantomJS
Code
class IntegrationTest(StaticLiveServerTestCase):
serialized_rollback = False
@classmethod
def setUpClass(cls):
# this will be executed at the start of IntegrationTest
super(IntegrationTest, cls).setUpClass()
import ipdb; ipdb.set_trace()
cls.driver = webdriver.PhantomJS("node_modules/phantomjs-prebuilt/bin/phantomjs") # input speed = normal
cls.driver.set_window_size(1440, 900) # input speed = need to hold key 3-5 seconds
cls.commonOp = commonOp(cls.driver, cls.live_server_url + settings.STATIC_URL + 'index.html')
cls.customDriver = customDriver(cls.driver)
@classmethod
def tearDownClass(cls):
# this will be executed at the end of IntegrationTest
IPDB
> /project/bx/integration_test/tests.py(20)setUpClass()
18 super(IntegrationTest, cls).setUpClass()
19 import ipdb; ipdb.set_trace()
---> 20 cls.driver = webdriver.PhantomJS("node_modules/phantomjs-prebuilt/bin/phantomjs")
21 cls.driver.set_window_size(1440, 900)
22 cls.commonOp = commonOp(cls.driver, cls.live_server_url + settings.STATIC_URL + 'index.html')
ipdb> n <- INPUT SPEED = NORMAL
> /project/bx/integration_test/tests.py(21)setUpClass()
19 import ipdb; ipdb.set_trace()
20 cls.driver = webdriver.PhantomJS("node_modules/phantomjs-prebuilt/bin/phantomjs")
---> 21 cls.driver.set_window_size(1440, 900)
22 cls.commonOp = commonOp(cls.driver, cls.live_server_url + settings.STATIC_URL + 'index.html')
23 cls.customDriver = customDriver(cls.driver)
ipdb> <- INPUT SPEED = SLOW! (3-5 seconds hold on key)
How can I fix this? Why is it happening?
Edit: I even tried using IPython when debugging to see if the input speed issue goes away, failed attempt.
EDIT: REPRO STEPS
in order to reproduce the same issue install phantomjs and selenium for python
$ pip install selenium
$ npm -g install phantomjs-prebuilt
$ python
>>> from selenium import webdriver
>>> webdriver.PhantomJS('/usr/local/bin/phantomjs')
>>> #try to type here.