Category : ui-automation

I need to run a loop through multiple elements having the same CSS selector and return true if the element.text() matches with the string. If there is no match then return false at the end. I tried something like below but it didn’t work: getProfilePresentOrNot(profileName){ var flag=0; cy.get(‘li>div>div>span’).each(($el,index,$list)=>{ if($el.text().includes(profileName)) { flag=1; } }); return flag; ..

Read more

I have the following trackers blocked during Cypress tests. Cypress keeps on logging these urls in the test runner logs which is ugly and interferes with other useful log messages and assertions and increases scrolling/searching effort from the user. Is there a way to disable logging of these urls in the test runner and console ..

Read more

Note: this question is not related to test retries, this is about running the whole spec again from beginning, not about retrying a failed it() block within a spec. According to Cypress docs: https://docs.cypress.io/guides/guides/module-api#cypress-run you can rerun failing spec/specs after the catching the failures of cypress.run() process. I cannot find a way to do so. ..

Read more

I am trying to make POST request in Cypress in order to perform auto login and redirect to dashboard page. Here is the Website link : https://admin-demo.nopcommerce.com Error The Code I have added to perform auto login is Cypress.Commands.add(‘autologin’, () => { cy.clearCookies(); let options = { method: ‘POST’, url: ‘https://admin-demo.nopcommerce.com/login?returnurl=%2Fadmin%2F’, headers: { ‘authority’: ‘admin-demo.nopcommerce.com’, ..

Read more

I am new to webdriverIO, while trying to run using cucumber framework, even though the execution is happening, I see the steps are retried as if there was a failure ERROR @wdio/local-runner: Failed launching test session: Error: Couldn’t find page handle at DevToolsDriver.getPageHandle (D:webdriveriotest2node_modulesdevtoolsbuilddevtoolsdriver.js:143:19) can anyone help how to resolve this? Source: Ask Javascript..

Read more

I am trying to automate the following case with JS and Protractor: I open https://www.booking.com, then input ‘Paris’ destination searchbox and select the first option in auto-suggested dropdown. However I can’t find this element in Elements inspector console. The element is following: enter image description here Does anyone have idea how this can be done? ..

Read more

For site testing, I am attempting to emulate a middle click (or scroll wheel click) on an element like the one below: <a id="example-link" href="https://www.google.com/" target="_blank" onclick="window.open(‘https://www.google.com/’,”,’width=500,height=500,resizable=1,scrollbars=1′); return false;"> <span>Middle Click Me</span> </a> I am using the following JS from some other answers on here var middleClick = new MouseEvent( "click", { "button": 1, "which": ..

Read more

I am playing around writing an automation script for http://automationpractice.com/index.php?controller=authentication&back=my-account using selenium webdriver and running the tests with jest I have the create account button defined as, get createAccountBtn() { return $("#SubmitCreate"); } and it is used here, createAcctBtnIsVisible() { this.createAccountBtn.waitForExist(); } In my test I used this to assert that the button is visible, ..

Read more

I wrote an automation script for filling out these mundane forms at work and everything seems to work except for the textarea part where I’m successfully able to update the value in the field using var textarea = document.getElementById(‘c4d981e9a2c98b0483252333_input’); textarea.value = ‘hi’; But this doesn’t register in the code as the submit button is still ..

Read more