I went back to watch other videos to understand what is the correct pronunciation of cypress like it is cp press or sy press. Questions are really good but the answers are confusing... Sorry for the negative comment but this what I feel. What do you mean by web packed monitor at 9:33? I didn't use any third party tool to select the element using class or id at 9:47 how can it only supports css this is incorrect. I also search in other websites and cypress documents Cypress supports a wide range of selectors, making it easy to target specific elements on your web pages. Here's a breakdown of the most common ones: Basic Selectors: - ID Selector: #elementId - Selects an element with the given ID. - Class Selector: .className - Selects all elements with the given class. - Tag Selector: tagName - Selects all elements with the given tag name (e.g., div , button , input ). - Attribute Selector: [attribute="value"] - Selects elements with the specified attribute and value. - Example: [data-test="my-element"] - Universal Selector: * - Selects all elements on the page. Combined Selectors: - Descendant Selector: ancestor tagName - Selects all elements with the given tag name that are descendants of the specified ancestor. - Example: div li - Selects all li elements within a div . - Child Selector: parent > child - Selects direct children of the specified parent. - Example: div > p - Selects all p elements that are direct children of a div . - Sibling Selector: element ~ sibling - Selects all siblings of the specified element. - Example: input ~ label - Selects all labels that are siblings of an input element. Other Useful Selectors: - nth-child Selector: tagName:nth-child(n) - Selects the nth child of the parent. - Example: li:nth-child(2) - Selects the second li element within its parent. - nth-of-type Selector: tagName:nth-of-type(n) - Selects the nth element of its type within its parent. - Example: input:nth-of-type(2) - Selects the second input element within its parent. - Contains Selector: [attribute*="value"] - Selects elements with an attribute that contains the specified value. - Example: [href*="google.com"] - Selects all elements with an href attribute containing "google.com". Cypress-Specific Selectors: - cy.get() : The most common selector in Cypress. It uses the same selectors as jQuery and accepts any valid CSS selector. - Example: cy.get('#my-element') - cy.contains() : Selects elements that contain specific text. - Example: cy.contains('Submit') - cy.has() : Selects elements that contain a child element matching the given selector. - Example: cy.get('ul').has('li:first-child') - cy.next() and cy.prev() : Selects the next or previous sibling element. - cy.parent() and cy.children() : Selects parent or child elements. Tips: - Use cy.get() as your primary selector: It's versatile and supports most CSS selectors. - Prioritize data-test attributes: For testing purposes, add data-test attributes to your elements for easier selection. - Use cy.contains() for text-based selection: It's a great alternative to cy.get() for elements that contain specific text. - Combine selectors for specificity: Use multiple selectors to narrow down your search and target the exact element you need.
Thank you sir.
I went back to watch other videos to understand what is the correct pronunciation of cypress like it is cp press or sy press. Questions are really good but the answers are confusing... Sorry for the negative comment but this what I feel. What do you mean by web packed monitor at 9:33? I didn't use any third party tool to select the element using class or id at 9:47 how can it only supports css this is incorrect. I also search in other websites and cypress documents
Cypress supports a wide range of selectors, making it easy to target specific elements on your web pages. Here's a breakdown of the most common ones:
Basic Selectors:
- ID Selector: #elementId - Selects an element with the given ID.
- Class Selector: .className - Selects all elements with the given class.
- Tag Selector: tagName - Selects all elements with the given tag name (e.g., div , button , input ).
- Attribute Selector: [attribute="value"] - Selects elements with the specified attribute and value.
- Example: [data-test="my-element"]
- Universal Selector: * - Selects all elements on the page.
Combined Selectors:
- Descendant Selector: ancestor tagName - Selects all elements with the given tag name that are descendants of the specified ancestor.
- Example: div li - Selects all li elements within a div .
- Child Selector: parent > child - Selects direct children of the specified parent.
- Example: div > p - Selects all p elements that are direct children of a div .
- Sibling Selector: element ~ sibling - Selects all siblings of the specified element.
- Example: input ~ label - Selects all labels that are siblings of an input element.
Other Useful Selectors:
- nth-child Selector: tagName:nth-child(n) - Selects the nth child of the parent.
- Example: li:nth-child(2) - Selects the second li element within its parent.
- nth-of-type Selector: tagName:nth-of-type(n) - Selects the nth element of its type within its parent.
- Example: input:nth-of-type(2) - Selects the second input element within its parent.
- Contains Selector: [attribute*="value"] - Selects elements with an attribute that contains the specified value.
- Example: [href*="google.com"] - Selects all elements with an href attribute containing "google.com".
Cypress-Specific Selectors:
- cy.get() : The most common selector in Cypress. It uses the same selectors as jQuery and accepts any valid CSS selector.
- Example: cy.get('#my-element')
- cy.contains() : Selects elements that contain specific text.
- Example: cy.contains('Submit')
- cy.has() : Selects elements that contain a child element matching the given selector.
- Example: cy.get('ul').has('li:first-child')
- cy.next() and cy.prev() : Selects the next or previous sibling element.
- cy.parent() and cy.children() : Selects parent or child elements.
Tips:
- Use cy.get() as your primary selector: It's versatile and supports most CSS selectors.
- Prioritize data-test attributes: For testing purposes, add data-test attributes to your elements for easier selection.
- Use cy.contains() for text-based selection: It's a great alternative to cy.get() for elements that contain specific text.
- Combine selectors for specificity: Use multiple selectors to narrow down your search and target the exact element you need.
Very very useful team , please make more of such videos 🙏
We may need to do some updates in the video 1.is also used for API testing 2.two types are assertions implicit and explicit
Thankyou sir giving wonderful questions and answers..
Thank you sir.
Custom commands can be created in explicit assertions right.....
Overall very useful. Question 39 for preserving cookies is removed from newer version of cypress. Do you have latest solution for that? Thank you
Xpath plugin is no longer supported
Cypress does not support iFrames ???
cypress support 😀
u need a external plugin
Not able to see the video
Hello, Video is good from our side, please refresh the page from your end. Thank you.
Thank you sir.