2 years ago

#45738

test-img

Sowjanya H M

Cypress- Whoops, there is no test to run. error on trying to visit a browser

I am trying to launch a browser. It launches the browser and fails to perform the next steps by throwing "Whoops, there is no test to run" error. Can someone please help. Below is the code for reference.

  1. List item
    describe("Salesforce Validation", () => {
      var email_array = [];
      var lastName_array = [];
      var firstName_array = [];
    
    
      it("Saleforce Validation1", () => {
        // cy.wait(2000);
        // cy.task("setHref", emails_array);
        // cy.task("getHref").then((emails_array) => {
            // cy.log(emails_array);
    
          cy.task("setFirstName", firstName_array);
          cy.task("getFirstName").then((firstName_array) => {
            cy.log(firstName_array);
    
    
          cy.task("setLastName", lastName_array);
          cy.task("getLastName").then((lastName_array) => {
            cy.log(lastName_array);
    
          cy.task("setemail", email_array);
          cy.task("getemail").then((email_array) => {
            cy.log(email_array);
    
            // cy.log(emails_array.length);
            // cy.log(emails_array);
            
            cy.request(
              "https://edplus-asu--qa.my.salesforce.com/?un=edplusqa%40edplus.asu.edu.qa&pw=qasalesforce8&startURL=%2F001"
            );
            cy.visit(
              "https://edplus-asu--qa.my.salesforce.com/home/home.jsp?source=lex"
            );
    
            cy.wait(3000);
    
            // cy.get('input[id="Login"]').click({ force: true });
            
            // cy.get('input[id="thePage:inputForm:continue"]').click({ force: true });
            
            // cy.get('button[class="slds-button branding-userProfile-button slds-button slds-global-actions__avatar slds-global-actions__item-action activated forceHeaderButton"]'
            // ).click();
            // https: cy.contains("View profile").click({ force: true });
            // cy.contains("Switch to Salesforce Classic").click({ force: true });
            cy.get('input[id="phSearchInput"]').click();
            cy.get('input[id="phSearchInput"]').type('utm25@qa.in', {
                  force: true,
                  });
            cy.get('input[id="phSearchButton"]').click();
             
            if (
                cy.get(
                  "#Interaction__c_body> table > tbody > tr.dataRow.even.last.first > th > a"
                ) != null
              ) {
                // click interaction
                cy.get(
                  "#Interaction__c_body > table > tbody > tr.dataRow.even.first > th > a"
                ).click();
    
    
              //  Validating fields present in SF
    
                cy.wait(2000);
                cy.get(
                  "#ep > div.pbBody > div:nth-child(2) > table > tbody > tr:nth-child(4) > td.dataCol.col02"
                ).should("have.text", 'embtest');
    
                cy.get(
                  "#ep > div.pbBody > div:nth-child(2) > table > tbody > tr:nth-child(6) > td.dataCol.col02"
                ).should("have.text", 'last');
    
                cy.get(
                  "#ep > div.pbBody > div:nth-child(2) > table > tbody > tr:nth-child(11) > td.dataCol.col02 > a"
                ).should("have.text", 'utm25@qa.in');
              //   cy.get(
              //     "#ep > div.pbBody > div:nth-child(2) > table > tbody > tr:nth-child(8) > td.dataCol.col02"
          //     //     ).should("have.text", 1 + phoneNumber);
          //       }
              }
             
          
            });// end lastName
          });
        });
      });
    });

java

cypress

cypress-testing-library

0 Answers

Your Answer

Accepted video resources