蓝色天空网 · mbsky.com
Selenium组件、能力与选型
WebDriver、IDE和Grid承担不同职责。
固定本地测试页的实际浏览器结果,不是在线Python解释器。下载代码后可在独立环境修改输入并重新运行。
本章Python入口 · 完整实验实现 · 本站测试服务 · 本站页面交互

当前输入实际检查
| 实际检查 | 结果 |
|---|---|
| fixture-initial-no-severe-errors | 通过 |
| current-browser | 通过 |
| current-browser-version | 通过 |
| current-binding | 通过 |
| real-WebDriver-session | 通过 |
| not-legacy-name-method | 通过 |
| screenshot-saved-actual-browser | 通过 |
| PNG-magic-actual-browser | 通过 |
| PNG-extent-actual-browser | 通过 |
| all-created-sessions-quit | 通过 |
本章完整入口
from selenium_lab import *
@case('selenium-intro')
def intro(l,d,b,s):
l.eq('current-browser',d.capabilities['browserName'],'MicrosoftEdge');l.eq('current-browser-version',d.capabilities['browserVersion'],'156.0.4314.58');l.eq('current-binding',selenium.__version__,'4.52.0');l.check('real-WebDriver-session',bool(d.session_id));l.eq('not-legacy-name-method',hasattr(d,'find_element_by_id'),False);l.pending_case('IDE-and-other-browsers','Actual IDE desktop/recording, Firefox/Safari/IE/mobile contexts not executed')
if __name__ == "__main__":
run('selenium-intro')