运行selenium脚本时,出现data页的情况。

1、没有打开自己的网址,只出现了data页。

这种情况一版是当前浏览器版本与本地浏览器驱动版本不一致导致。

解决办法:

先查看浏览器版本,以谷歌为例,进入设置页。点击关于栏,可查看浏览器版本

之后下载与自己浏览器对应的浏览器驱动并设置好环境变量即可。

最新谷歌浏览器驱动下载地址如下 :

Chrome for Testing availability

2、 即打开了自己的网址,又打开了多余的data页

这种情况一般是测试用例模块多次调用浏览器驱动driver=webdriver.chrome()导致。

解决办法是整个自动化脚本中调用同一个driver即可。

可在一个py模块中设置浏览器驱动实例driver,其它模块调用该模块中的driver。

资源宝贵,请及下载 Book Description The Selenium WebDriver 3.x Technology is an open source API available to test both Browser and Mobile applications. It is completely platform independent in that tests built for one browser or mobile device, will also work on all other browsers and mobile devices. Selenium supports all major development languages which allow it to be tied directly into the technology used to develop the applications. This guide will provide a step-by-step approach to designing and building a data-driven test framework using Selenium WebDriver, Java, and TestNG. The book starts off by introducing users to the Selenium Page Object Design Patterns and D.R.Y Approaches to Software Development. In doing so, it covers designing and building a Selenium WebDriver framework that supports both Browser and Mobile Devices. It will lead the user through a journey of architecting their own framework with a scalable driver class, Java utility classes, JSON Data Provider, Data-Driven Test Classes, and support for third party tools and plugins. Users will learn how to design and build a Selenium Grid from scratch to allow the framework to scale and support different browsers, mobile devices, versions, and platforms, and how they can leverage third party grids in the Cloud like SauceLabs. Other topics covered include designing abstract base and sub-classes, inheritance, dual-driver support, parallel testing, testing multi-branded applications, best practices for using locators, and data encapsulation. Finally, you will be presented with a sample fully-functional framework to get them up and running with the Selenium WebDriver for browser testing. By the end of the book, you will be able to design your own automation testing framework and perform data-driven testing with Selenium WebDriver. Contents 1: BUILDING A SCALABLE SELENIUM TEST DRIVER CLASS FOR WEB AND MOBILE APPLICATIONS 2: SELENIUM FRAMEWORK UTILITY CLASSES 3: BEST PRACTICES FOR BUILDING SELENIUM PAGE OBJECT CLAS
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

武当豆豆

为国家GDP快速增长做贡献

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值