过去两年(至少),我一直在使用75版本的Chrome。我有一个自动化环境,实际上是我在使用此版本的Chrome时开发的。
我想使用最新的Chrome版本之一升级自动测试。在尝试使用版本80和79(当然,我使用了适当的chromedrivers)时,我发现由于某种原因,基本的帧切换操作会进入TimeOutException。我没有尝试过版本78和以下的版本,并且目前只能在版本75中执行这些切换框操作。我的默认隐式等待时间为20秒,因此即使这与版本75保持一致,这也不成问题。 / p>
我怎么能找到问题所在?我在搜索过程中没有发现任何问题或投诉,因此我认为对所看到的内容有很好的解释。请帮助我,以便我能够升级我的自动化测试环境
这是一个代码示例:
def Point_Users_Table(self, verify_UsersTable=False, Retries=5):
for attempt in range(Retries):
try:
Device_Panel_Frame.Click_System_Btn(self)
sleep(0.5)
Left_Panel_Frame.Click_Security(self)
sleep(3)
self.driver.switch_to.default_content()
Main_Body = self.driver.find_element_by_name('main_page')
self.driver.switch_to.frame(Main_Body)
Users_TAB = self.driver.find_element_by_id('tab_users')
Users_TAB.click()
if Users_TAB.get_attribute('class') != 'tab tabactive':
raise Exception()
# Move to the inner frame that holds the Users table
Security_Frame = self.driver.find_element_by_name('Security')
self.driver.switch_to.frame(Security_Frame)
header2find = self.driver.find_element_by_id('sec_user_header')
# Verify that the User TAB was found
if header2find.text == 'Local User Management':
break
else:
raise Exception
except NoSuchElementException:
if verify_UsersTable:
return True # The users table doesn't exist
continue
except:
self.Refresh_Screen()
continue
if verify_UsersTable:
return False
我切换到的第二帧(Security_Frame)是我无法使用较新的Chrome的地方。
我可以说,当我使用版本80和81的chromedriver时,有时只能找到Security_Frame。但是,在版本75中总是可以找到