pycharm 自動化測試selenium+Python3遇到的問題及解決方法(三)

1、調用js拖動滾動條

#調用JavaScript代碼
def script(self,src):
    return self.driver.execute_script(src)

#滾動條拉到底部
js_scroll = "document.querySelector('.single-page-con').scrollTo(0, 2000)"
def scroll(self):
    self.script(self.js_scroll)

2、TypeError: ‘Servicerepair’ object cannot be interpreted as an integer

:函數沒有加self

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章