测试积点老人 发表于 2018-8-13 15:12:28

Day2-5测试积点任务

问题:
switch_to.frame()进入frame会报错要操作的元素截图如下:

我想点击“游戏用户”,但是用switch_to.frame()进入frame就会报错
我的代码:
fr_1=driver.find_elements_by_xpath("//frame[@name='topFrame']")
driver.switch_to.frame(fr_1)
报错信息:
Traceback (most recent call last):
File "C:\Users\CT\Desktop\Python\AdminWeb.py", line 42, in <module>
    LoginTest.gameyonghu()
File "C:\Users\CT\Desktop\Python\AdminWeb.py", line 36, in gameyonghu
    driver.switch_to.frame(fr_1)
File "C:\Python35\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 87, in frame
    self._driver.execute(Command.SWITCH_TO_FRAME, {'id': frame_reference})
File "C:\Python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
File "C:\Python35\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchFrameException: Message: frame id has unexpected type

libingyu135 发表于 2018-8-14 11:38:37

没定义frame id ?

qqq911 发表于 2018-8-14 12:52:33

frame id的类型定义有问题

jingzizx 发表于 2018-8-14 13:14:12

frame id 有问题
页: [1]
查看完整版本: Day2-5测试积点任务