当前位置:网站首页>Selenium library 4.5.0 keyword explanation (4)
Selenium library 4.5.0 keyword explanation (4)
2022-07-03 23:36:00 【Mark community】
SeleniumLibrary4.5.0 Keyword details ( Four )
Library version :4.5.0
Library scope : overall situation
Named parameters : Supported
brief introduction
SeleniumLibrary yes Robot Framework Of Web Test library .
This document explains how to use SeleniumLibrary Keywords provided . About installation , Support and other information , Please see the python3.9.0 + robotframework + selenium3 Instance experience .
of robotframework More information about the framework , Please see the https://blog.csdn.net/mask5726/category_10537277.html.
SeleniumLibrary Use... Internally Selenium WebDriver Module to control Web browser . About general Selenium For more information , Please see the http://seleniumhq.org.
The content list
1、 Element localization
2、 Browsers and windows
3、 Overtime , Wait and delay
4、 Operation fault function
5、 Boolean parameters
6、webDriver event
7、 Thread support
8、 plug-in unit
9、 introduce
11、 keyword
keyword
SeleniumLibrary4.5.0 There are a total of keywords for 175 individual , Let's look at it one by one :
1 Add Cookie
add to cookie
Parameters :
name
value
path=None
domain=None
secure=None
expiry=None
explain :
take cookie Add to current session .
Name and value are required , route , Domain , Security and expiration are optional . Expiry Support and DateTime Library or era timestamp in the same format .
Example:
Add Cookie foo bar
Add Cookie foo bar domain=example.com
Add Cookie foo bar expiry=2027-09-28 16:21:35 # Expiry As a time stamp .
Add Cookie foo bar expiry=1822137695 # Expiry As a period of seconds .
Be careful :
stay SeleniumLibrary 3.0 Previous version ,expiry Invalid settings .
2 Add Location Strategy
Add positioning strategy
Parameters :
strategy_name
strategy_keyword
persist=False
explain :
Add custom location policy .
Information on how to create and use custom policies , see also “ Custom locator ”. Delete location policy can be used to delete registered policies .
By default , The location policy will be automatically deleted after leaving the current range . take persist Set to true ( See Boolean parameters ) The positioning strategy will remain registered throughout the life cycle of the test .
3 Alert Should Be Present
The alarm should exist
Parameters :
text=
action=ACCEPT
timeout=None
explain :
Verify that there are alerts , And accept the alarm by default .
If there is no alarm , The failure . If the text is a non empty string , Is used to verify the alarm message . Alerts are accepted by default , However, the behavior can be controlled by using the same operation parameters as the operation alarm .
Timeout specifies how long to wait for the alarm to display . If not given , The global default timeout is used .
Be careful :
action and timeout Parameter is SeleniumLibrary 3.0 What's new in . In previous releases , The alarm is always accepted , And the timeout is hard coded to one second .
4 Alert Should Not Be Present
Alarms should not exist
Parameters :
action=ACCEPT
timeout=0
explain :
Verify that no alerts exist .
If the alarm does exist , be action Parameters determine how it should be handled . By default , The alarm was accepted , But it can also be used with “ Handle alarms ” Keyword close or open it in the same way .
Timeout specifies how long to wait for the alarm to display . By default , Don't wait for the alarm at all , But if the alarm may be delayed , You can specify a custom time . Information about grammar , See the time format section .
Be careful :
SeleniumLibrary 3.0 New features in .
5 Assign Id To Element
take id Assign to element
Parameters :
locator
id
explain :
Assign a temporary... To the element specified by the locator ID.
If the locator is complex and / or XPath The expression is slow and requires multiple , This is mainly useful . When reloading the page , The identifier will expire .
For more information about locator Syntax , Please see the “ Positioning elements ” part .
Example :
Assign ID to Element //ul[@class=‘example’ and ./li[contains(., ‘Stuff’)]] my id
Page Should Contain Element my id
. The above example will be a complex xpath The positioned element is used my id To express , So the page contains my id This element .
边栏推荐
- 2022 examination of safety production management personnel of hazardous chemical production units and examination skills of safety production management personnel of hazardous chemical production unit
- Pandaoxi's video
- [15th issue] Tencent PCG background development internship I, II and III (OC)
- 炒股開戶傭金優惠怎麼才能獲得,網上開戶安全嗎
- Fudan 961 review
- Design of logic level conversion in high speed circuit
- Amway by head has this project management tool to improve productivity in a straight line
- D30:color tunnels (color tunnels, translation)
- Distributed transaction -- middleware of TCC -- selection / comparison
- [source code] VB6 chat robot
猜你喜欢

Common mode interference of EMC

Idea integrates Microsoft TFs plug-in

Current detection circuit - including op amp current scheme
![Docking Alipay process [pay in person, QR code Payment]](/img/30/665580241020ee3adb872e725f0624.jpg)
Docking Alipay process [pay in person, QR code Payment]

Selenium check box

How to understand the gain bandwidth product operational amplifier gain

A preliminary study on the middleware of script Downloader

Runtime. getRuntime(). totalMemory/maxMemory()

2022.02.13

EPF: a fuzzy testing framework for network protocols based on evolution, protocol awareness and coverage guidance
随机推荐
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Gossip about redis source code 76
Docking Alipay process [pay in person, QR code Payment]
股票开户最低佣金炒股开户免费,网上开户安全吗
Analysis of refrigeration and air conditioning equipment operation in 2022 and examination question bank of refrigeration and air conditioning equipment operation
2022.02.14
What are the securities companies with the lowest Commission for stock account opening? Would you recommend it? Is it safe to open an account on your mobile phone
ThreadLocal function, scene and principle
Shiftvit uses the precision of swing transformer to outperform the speed of RESNET, and discusses that the success of Vit does not lie in attention!
在恒泰证券开户怎么样?安全吗?
How to quickly build high availability of service discovery
D24:divisor and multiple (divisor and multiple, translation + solution)
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
EPF: a fuzzy testing framework for network protocols based on evolution, protocol awareness and coverage guidance
How to solve the "safe startup function prevents the operating system from starting" prompt when installing windows10 on parallel desktop?
Design of logic level conversion in high speed circuit
Mongoose the table associated with the primary key, and automatically bring out the data of another table
Current detection circuit - including op amp current scheme
Hcip day 14 notes
Op amp related - link