Cypress Tutorial
Selected Reading
- Cypress - Discussion
- Cypress - Useful Resources
- Cypress - Quick Guide
- Cypress - GitHub
- Cypress - Plugins
- Cypress - Reports
- Cypress - Configuration of JSON File
- Cypress - Hooks
- Cypress - Environment Variables
- Cypress - Fixtures
- Cypress - Custom Commands
- Cypress - Debugging
- Cypress - Screenshots and Videos
- Cypress - Dashboards
- Cypress - Prompt Pop-up Window
- Cypress - Data Driven Testing
- Cypress - File Upload
- Cypress - Get and Post
- Cypress - Cookies
- Cypress - Mouse Actions
- Cypress - Web Tables
- Cypress - Frames
- Cypress - Hidden Elements
- Cypress - Child Windows
- Cypress - Alerts
- Cypress - Dropdown
- Cypress - Tabs
- Cypress - Checkbox
- Cypress - jQuery
- Cypress - Working with XHR
- Cypress - Asynchronous Behavior
- Cypress - Text Verification
- Cypress - Assertions
- Cypress - Locators
- Cypress - Aliases
- Cypress - Variables
- Cypress - Basic Commands
- Cypress - Supported Browsers
- Cypress - Build First Test
- Cypress - Test Runner
- Cypress - Architecture and Environment Setup
- Cypress - Introduction
- Cypress - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Cypress - Web Tables
Cypress - Web Tables
风暴能够处理网页。 表格基本上分为两类:动态和静态。 固定表格的栏目和行数与动态表格不同。
在《html法典》中,表格以表格标语表示,而浏览则以斜线表示,栏目按斜线表示。
为了进入各行,Cypress指挥系统如下:
cy.get("tr")
为进入各栏,Cypress指挥系统如下:
cy.get("td") or cy.get("tr td")
查阅一栏,特别安全局的表述如下:
td:nth-child(column number)
To iterate through the rows/columns of the table, the Cypress command each is used.
在“旋风”中,我们有“指挥”next至,排在紧接下。 这一指挥必须经过指挥。 突击队被用来转移到前面的兄弟姐妹。
下表的Html结构如下:
Example
让我们以表格为例,并核实第二栏(Open Source)中与价值 Sel相对应的内容,该栏是同OL联系的第一栏。
以下屏幕将登在你的电脑上:
Implementation
下面是实施与表格有关的气旋风暴指挥系统:
describe( Tutorialspoint Test , function () { // test case it( Scenario 1 , function (){ //URL launch cy.visit("https://sqengineer.com/practice-sites/practice-tables-selenium/") // identify first column cy.get( #table1> tbody > tr > td:nth-child(1) ).each(($elm, index, $pst)=> { // text captured from column1 const t = $elm.text(); // matching criteria if (t.includes( Selenium )){ // next sibpng captured cy.get( #table1 > tbody > tr > td:nth-child(1) ) .eq(index).next().then(function(d) { // text of following sibpng const r = d.text() //assertion expect(r).to.contains( Commercial ); }) } }) }); });
产出如下:
执行记录显示,第1栏所列数值为公开来源。 这是因为紧随同一行的Selenium(第一栏)的精干。
Advertisements