当前位置:网站首页>selenium进阶
selenium进阶
2022-06-12 14:18:00 【小小微的博客】
通过selenium IDE录制的脚本转化为junit 4的代码在selenium RC中运行遇到的几个问题。
1.由于页面加载时间超长,下一个操作执行的时候前一个页面未加载出来,无法继续
在两个动作之间加入如下代码即可
Thread.sleep(10000);//等待十秒
2.selenium IDE录制的脚本中出现command为selectframe的方法,它的target和value均为空,转化为Java代码后如下,无法执行成功
//selenium.selectFrame();
是由于页面中包含了iframe之类的元素导致的
使用如下代码跳出这个元素即可
selenium.selectFrame("relative=top");

3.使用selenium IDE 录制时,出现了两个方法waitForPopUp、selectWindow,回放时无法使用
如下
selenium.waitForPopUp("selenium_blank35502", "5000");//等待弹出窗口加载,这个方法不好使
selenium.selectWindow("应用运维操作执行页面");//选择弹出窗口,里面填windowTitles,可通过get方法获得
其中第一个方法是等待窗口加载,第二个方法是选择一个window,导入到selenium RC中使用junit测试,第一个方法报错超时,第二个方法找不到相应的元素(即window)
解决方案:
1.将等待这个方法可以注销
2.既然报错是找不到这个window,那么久通过selenium提供的selenium.getAllWindowTitles()方法先找到这个window的title,再通过select选中这个window,就可以继续执行下面的操作了

边栏推荐
- Player practice 15 xdemux and avcodecparameters
- Use Baidu AIP to obtain the text in the specified area of the screen
- 工业机械臂(机器人)视觉定位引导系统
- Reverse analysis from x86 to x64tips
- Leetcode 2176. 统计数组中相等且可以被整除的数对
- 华为设备配置OSPF伪连接
- Raspberry pie get temperature and send pictures to email
- Introduction to functions (inline functions and function overloading)
- Codeforces Round #798 (Div. 2)(A~D)
- Design of PLC intelligent slave station based on PROFIBUS DP protocol
猜你喜欢

Lua callinfo structure, stkid structure resolution

Conversion of player's actual 10 pixel format and size

En langage C, la fonction principale appelle une autre fonction et assemble le Code pour comprendre

Player actual combat 21 audio and video synchronization

Dynamic search advertising intelligent search for matching keywords

ADB command (2) use monkey to test

华为设备配置OSPF伪连接

Markdown edit

Design of PLC intelligent slave station based on PROFIBUS DP protocol

In C language, the main function calls another function, which is understood by assembly code
随机推荐
Server concurrency - note 1
Lua callinfo structure, stkid structure resolution
Player practice 20 audio thread and video thread
How test engineers transform test and open
Detailed explanation of C language memset
Tu oses le croire? Il m'a fallu deux jours pour développer un système de gestion.
En langage C, la fonction principale appelle une autre fonction et assemble le Code pour comprendre
Player actual combat 12 QT playing audio
Redis核心配置和高级数据类型
Socket model of punctual atom stm32f429 core board
新技术:高效的自监督视觉预训练,局部遮挡再也不用担心!
Solve the problem that IEEE latex template cannot display Chinese
C secret script Chapter 1: data storage (in-depth analysis) supplement
TestEngine with ID ‘junit-vintage‘ failed to discover tests
[early knowledge of activities] list of recent activities of livevideostack
Pay attention to click and pursue more users to enter the website. What bidding strategy can you choose?
华为设备配置H虚拟专用网
Player actual combat 22 to solve the problems of flower screen and Caton
QA of some high frequency problems in oauth2 learning
Conversion of player's actual 10 pixel format and size