I am trying to select li and click/check on span which is checkbox but, can’t do that. Here, following I tried. Here, in above code I want to select li where “abc account” and once found want to click on span which have class tree-checkbox. So, I tried. But, it says there are multiple elements found. above code find the
Tag: cypress
How to use within() function with contains() function incypress
I have a datepicker calendar as below [![enter image description here][1]][1] To select a particular date I am using this code Now to select the date I am using below approach which is working fine but I don’t wanted to use nth-of-type(1) because it will cause issue in future I tried this approach whic didn’t work Can you folks help
playwright equivalent of find() in cypress
Is there a way to traverse through html elements in playwright like cy.get(“abc”).find(“div”) in cypress? In other words, any find() equivalent method in playwright? page.locator(“abc”).find() is not a valid method in playwright though 🙁 Answer You can just combine the selectors, this will resolve to div below abc
How to find one of many selectors that contain another nested selector
I have a web page and there is a list with multiple elements: First type of element: Second type of element: As you can see the second one does not contain the “imstuck” class as well as the “Something” text. (this is an example, in real case the second line of code is nested deeper) I want to find out
How add two values[1,2 elements] and verify its equal to result[3 element]
I need to verify if the sum of two elements is equal to the result shown on the UI. Below is the html structure for the three elements and need to do the calculation on the h1 tags. Below is the code I am trying to execute but nothing comes up in the test. The test runs and passes but
Cypress error while migrating from js to ts (ts2345) (ts2339)
Currently trying to convert a cypress(10) project from js to ts. My Custom commands don’t seem to be working, i get the following error while defining the custom command(the name of the custom command is underlined in red): My Custom command code: When using those commands (*.ts file now after renaming from *.js) i also get an error: What do
Not able to switch to a new tab or window using cypress
I have one scenario where I have to click on one link, that opens a new tab/window, As cypress does not support multiple tabs, I have found below workaround but its not working, It opens the new tab, but not able to switch the new tab and my test is failing with the error : expected redirect to have been
How to edit the MSAL login commands to make it work for multiple users?
I have the following code working and I’m able to login with username and password. I am working with Cypress to login to a webapp with MSAL. In the e2e Testfile: Command.js: Imported auth.js Got credentials in authSettings.json As you can see I am able to login with the credentials which were saved as variable in the authSettings.json file. This
Adding custom functions for Synpress/Cypress Project
I want to add custom functions to a synpress project. (Synpress is a wrapper around Cypress which allows interaction with Metamask). Note there is a question: Cypress custom command is not recognized when invoked but even though I read through this QA, my custom functions are not recognized. This is my project setup. From the answer mentioned before All the
How to get value of a child based on the text of another child within the same JavaScript parent
so I want to be able to get “Text B” from the table below using Cypress but have tried many things and I can only get “Party B”. I have been using cy.get(div[class=”table”]).contains(div[class=”label”], “Party B”).click() to click on the text for “Party B”, but don’t know how to click on the other child of the same parent. Answer To get