当前位置:网站首页>Selenium library 4.5.0 keyword explanation (II)
Selenium library 4.5.0 keyword explanation (II)
2022-07-03 23:36:00 【Mark community】
SeleniumLibrary4.5.0 Keyword details ( Two )
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
Browsers and windows
When SeleniumLibrary When talking about browsers and windows , Have different conceptual meanings . This chapter will explain these differences .
browser
call Open Browser or Create WebDriver When a keyword , It will use Selenium WebDriver API Create a new Selenium WebDriver example . use SeleniumLibrary The term , A new browser will be created . Open the browser or create through multiple calls WebDriver, You can launch multiple independent browsers at the same time (Selenium Webdriver example ). These browsers are usually independent of each other , And will not share Cookie, Data such as conversations or personal data . Usually , When the browser starts , It will create a window to display to the user .
window
The window is part of the browser , The browser loads the website and presents it to the user . All the content of the site is the content of the window . Windows are children of browsers . stay SeleniumLibrary in , Browser is WebDriver Synonyms for instances . A browser may have multiple windows . Windows Can be displayed as tabs , It can also be displayed as a separate window or pop-up windows with different positions and sizes . Windows belonging to the same browser usually share session details , for example cookie. If you need to separate session details ( for example , Log in with two different users ), You must create two browsers (Selenium WebDriver example ). You can use the application being tested or Execute Javascript Keyword example to open a new window :
Execute Javascript window.open() # Open a location as about:blank The new window of
The following example opens multiple browsers and windows , To demonstrate how to use different keywords to interact with browsers , And how to attach windows to these browsers .
Structure:
BrowserA
Window 1 (location=https://robotframework.org/)
Window 2 (location=https://robocon.io/)
Window 3 (location=https://github.com/robotframework/)
BrowserB
Window 1 (location=https://github.com/)
Example:
Open Browser https://robotframework.org ${BROWSER} alias=BrowserA # Open with the first window BrowserA.
Execute Javascript window.open() # Open the second window in the browser .
Switch Window locator=NEW # Switch to BrowserA The second window in
Go To https://robocon.io # The second window navigates to robocon Website .
Execute Javascript window.open() # Open the third window in the browser .
KaTeX parse error: Expected 'EOF', got '#' at position 49: …tor=NEW #̲ Switch to BrowserA No …{BROWSER} alias=BrowserB # Open with the first window BrowserB.
KaTeX parse error: Expected 'EOF', got '#' at position 39: …ion #̲ {location} Get location is :https://www.github.com
Switch Window ${handle} browser=BrowserA # BrowserA The second window is selected .
KaTeX parse error: Expected 'EOF', got '#' at position 39: …ion #̲ {location} Get location is : https://robocon.io/
@{locations 1} Get Locations # By default , List the currently active browsers (BrowserA) The next position .
@{locations 2} Get Locations browser=ALL # By using browser = ALL Parameter keywords list all locations in all browsers .
The above example @ {locations 1} Contains the following windows :https://robotframework.org/,https://robocon.io/ and https://github.com/robotframework/’.
@ {locations 2} Contains the following windows :https://robotframework.org/、https://robocon.io/、https://github.com/robotframework/' and ’https://github.com/
边栏推荐
- 2022 t elevator repair registration examination and the latest analysis of T elevator repair
- How to prevent malicious crawling of information by one-to-one live broadcast source server
- [MySQL] sql99 syntax to realize multi table query
- SQL data update
- ADB related commands
- 股票开户最低佣金炒股开户免费,网上开户安全吗
- Format cluster and start cluster
- 2022 chemical automation control instrument examination content and chemical automation control instrument simulation examination
- Text replacement demo
- [15th issue] Tencent PCG background development internship I, II and III (OC)
猜你喜欢
In VS_ In 2019, scanf and other functions are used to prompt the error of unsafe functions
MLX90614 driver, function introduction and PEC verification
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
"Learning notes" recursive & recursive
Investment demand and income forecast report of China's building ceramics industry, 2022-2028
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
Tencent interview: can you pour water?
Research Report on the scale prediction of China's municipal engineering industry and the prospect of the 14th five year plan 2022-2028
Unsafe and CAS principle
Sort merge sort
随机推荐
Text replacement demo
Xiangong intelligent obtained hundreds of millions of yuan of b-round financing to accelerate the process of building non-standard solutions with standardized products
Simple solution of m3u8 file format
[note] glide process and source code analysis
Recursion and recursion
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
Exclusive download! Alibaba cloud native brings 10 + technical experts to bring "new possibilities of cloud native and cloud future"
URLEncoder. Encode and urldecoder Decode processing URL
[MySQL] sql99 syntax to realize multi table query
Fluent learning (4) listview
Weekly leetcode - nc9/nc56/nc89/nc126/nc69/nc120
Investment demand and income forecast report of China's building ceramics industry, 2022-2028
Gossip about redis source code 79
Live app source code, jump to links outside the station or jump to pages inside the platform
Go error collection | talk about the difference between the value type and pointer type of the method receiver
Is the controller a single instance or multiple instances? How to ensure the safety of concurrency
How about opening an account at Hengtai securities? Is it safe?
Introduction to the gtid mode of MySQL master-slave replication
Interpretation of corolla sub low configuration, three cylinder power configuration, CVT fuel saving and smooth, safety configuration is in place
How can I get the Commission discount of stock trading account opening? Is it safe to open an account online