0

I am trying to run 3 Java TestNG classes on click of testng.xml file but only 1st is running . Rest of Below file is not running under testng.xml Below is testng.xml file

<suite name="AutomationSuite" parallel="none">

  <test name="simple">

    <classes>
      <class name="Script.OpenAccount"/>
        <class name="Script.openContact"/>
         <class name="Script.Open_Case"/>
        </classes>
      </test>

  </suite> 

and Below is driverInstance file where i am opening my FF browser and entering the link

public class DriverInstance {
    public static WebDriver driver;

  @BeforeTest
  public void beforeTest() {
  driver = new FirefoxDriver();

      driver.navigate().to("https://ppmss360.ford.qa.ams.hpmsdynamics.com");
      driver.manage().window().maximize();
  }

  @AfterTest
  public void afterTest() {
  //driver.close();
  }

Below is my test class

@Test
  public void f() throws InterruptedException {
      LoginCRM log = new LoginCRM(driver);
      log.login();
      System.out.println("login is done");
      WebDriverWait wait1 = new WebDriverWait(driver,50);
        wait1.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//nobr[text()='Service']")));
        System.out.println("clicked on service");


      Dashboard_POM dashobj = new Dashboard_POM(driver);
      dashobj.clk_act();
      System.out.println("clicked on account");

      driver.switchTo().frame("contentIFrame");
        Thread.sleep(5000);
        try
        {
            Acc_landingPage_Pom obj1 = new Acc_landingPage_Pom(driver);
            obj1.rec_open();
            System.out.println("account page is opened");
        }
        catch(Exception e)
        {

        }

        Switching.switchWindow();
        Dashboard_POM obj2 = new Dashboard_POM(driver);
    Set<String> allwhs = driver.getWindowHandles();
    System.out.println(allwhs);


    //Thread.sleep(5000);
    WebDriverWait wait2 = new WebDriverWait(driver, 50);
    wait2.until(ExpectedConditions.presenceOfElementLocated(By.xpath(".//*[@id='account|NoRelationship|Form|Mscrm.Form.account.Save-Large']")));
    Switching.backtomainWindow();
        obj2.logout_btn();
        }

Below is screenshot of errorenter image description here

Below is method in Debug mode window

Thread [main] (Suspended)   
    <obsolete method in<unknown declaring type>>    
    NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]  
    NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available   
    DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available   
    Method.invoke(Object, Object...) line: not available    
    MethodInvocationHelper.invokeMethod(Method, Object, Object[]) line: 85  
    Invoker.invokeMethod(Object, ITestNGMethod, Object[], int, XmlSuite, Map<String,String>, ITestClass, ITestNGMethod[], ITestNGMethod[], ConfigurationGroupMethods, FailureContext) line: 639 
    Invoker.invokeTestMethod(Object, ITestNGMethod, Object[], int, XmlSuite, Map<String,String>, ITestClass, ITestNGMethod[], ITestNGMethod[], ConfigurationGroupMethods, FailureContext) line: 816 
    Invoker.invokeTestMethods(ITestNGMethod, XmlSuite, Map<String,String>, ConfigurationGroupMethods, Object, ITestContext) line: 1124  
    TestMethodWorker.invokeTestMethods(ITestNGMethod, Object, ITestContext) line: 125   
Rahil Kumar
  • 426
  • 8
  • 23

0 Answers0