调试phantomJS webdriver时python输入延迟

调试phantomJS webdriver时python输入延迟,python,django,selenium-webdriver,phantomjs,ipdb,Python,Django,Selenium Webdriver,Phantomjs,Ipdb,所以我试着用ipdb调试运行django/phantomjs/selenium webdrive的测试,但是交互式调试器的输入太慢了,我需要按住一个键3-5秒才能写出这个字符 所以我找到了它,发现它是在启动幻影之后发生的 代码 IPDB 我已经更改并测试了我的代码,以便在没有延迟的情况下使用Firefox(),因此这绝对是一个特定于phantomjs的代码issue@user1071182在ipdb interactive shell上,我可以通过按住任何字母来解决这个问题,直到输入速度恢复正常

所以我试着用ipdb调试运行django/phantomjs/selenium webdrive的测试,但是交互式调试器的输入太慢了,我需要按住一个键3-5秒才能写出这个字符

所以我找到了它,发现它是在启动幻影之后发生的

代码 IPDB
我已经更改并测试了我的代码,以便在没有延迟的情况下使用Firefox(),因此这绝对是一个特定于phantomjs的代码issue@user1071182在ipdb interactive shell上,我可以通过按住任何字母来解决这个问题,直到输入速度恢复正常。。。如果您需要更多帮助,请告诉我:这是一个非常奇怪的错误。我只是在使用一个普通的python控制台,但当我按住一个键时,它会交替快速/正常打印几毫秒,然后暂停几毫秒,然后快速暂停,等等@user1071182,准确地说,继续这样做直到它被修复,可能需要大约40秒的时间来按住一个键…这里也是一样,但我注意到这与时间无关。实际上,每按2-3下,只有一个键起作用。例如,两次按键被忽略,而第三次按键实际起作用。另一件重要的事情是,它只发生在npm安装的PhantomJS上。通过apt get(ubuntu)安装时,所有功能正常。
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
> /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)
$ pip install selenium
$ npm -g install phantomjs-prebuilt
$ python
>>> from selenium import webdriver
>>> webdriver.PhantomJS('/usr/local/bin/phantomjs')
>>> #try to type here.