当前位置:网站首页>Selenium test page content download function
Selenium test page content download function
2022-07-24 21:06:00 【zljun8210】
Because of the needs of the project , Export to... Supported by the test page Excel function , It is recorded as follows .
The export function has different implementation methods on different pages , Now the implementation and testing of the two pages are recorded .
1、 The first 1 Kind of , Through the statistics tr Element to determine the amount of data to export .
Its page file is as follows :

Get the test code of the content :
# Get how many pieces of data
assetgrid = self.driver.find_element_by_xpath('//*[@id="tab_grid"]/div/div[1]/div/table/tbody')
assets = assetgrid.find_elements_by_xpath('tr')
assetcounts = len(assets) - 1
log.info(' The page shows %d Data ' % assetcounts)2、 The first 2 Kind of , Calculate by element height ( Because the data exceeds 1 page , and tr The element method can only count the current 1 Data volume of pages )
The page file is as follows :

The test code is as follows :
grids = self.driver.find_element_by_xpath('//*[@id="machinelist"]/div/div[1]/div')
hei = grids.size["height"]
counts = int(hei) / 27
log.info(' The current is %d Data ' % counts)边栏推荐
- How to learn automated testing
- 怎么在中金证券购买新课理财产品?收益百分之6
- Vscode connected to the remote server cannot format the code / document (resolved)
- Lazily doing nucleic acid and making (forging health code) web pages: detained for 5 days
- Failed to create a concurrent index, leaving an invalid index. How to find it
- Lenovo Filez helps Zhongshui North achieve safe and efficient file management
- How to use named slots
- Transport layer protocol parsing -- UDP and TCP
- Summary of yarn capacity scheduler
- Penetration test - command execution injection
猜你喜欢

2022 chemical automation control instrument test question simulation test platform operation

What does software testing need to learn?
![[feature transformation] feature transformation is to ensure small information loss but high-quality prediction results.](/img/ad/6f5d97caa3f5163197ba435276a719.png)
[feature transformation] feature transformation is to ensure small information loss but high-quality prediction results.

whistle ERR_ CERT_ AUTHORITY_ INVALID

Opencv learning Day2
![[advanced data mining technology] Introduction to advanced data mining technology](/img/93/cb5ee07bff50662ad2496ca2bb39da.png)
[advanced data mining technology] Introduction to advanced data mining technology

Use of cache in C #

npm Warn config global `--global`, `--local` are deprecated. Use `--location=global` instead

PC port occupation release
![[summary of Feature Engineering] explain what features are and the steps of feature engineering](/img/29/f9643affd3aaf9d83c5b81394d29a7.png)
[summary of Feature Engineering] explain what features are and the steps of feature engineering
随机推荐
Five common misuse of async/await
Oracle primary key auto increment setting
ECCV 2022 open source | target segmentation for 10000 frames of video
How to learn automated testing? Can you teach yourself?
Alibaba Sentinel 基操
Summary of yarn Explorer
Is it safe for Hengtai securities to open an account?
Do you want to enroll in a training class or study by yourself?
What does software testing need to learn?
Shenzhen Merchants Securities account opening? Is it safe to open a mobile account?
Lua environment configuration
Top 10 in China's HCI software market: Huawei, Xinhua, Shenxin, VMware, Lenovo, smartx, Inspur, Qingyun, lutanli, dawn
About the acid of MySQL, there are thirty rounds of skirmishes with mvcc and interviewers
Intranet penetration learning (I) introduction to Intranet
95. Puzzling switch
How to apply Po mode in selenium automated testing
Processing of null value of Oracle notes
[install PG]
Drive subsystem development
Kubernetes resource list: how to create resources?