unable to execute testng.xml file through command prompt window

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

unable to execute testng.xml file through command prompt window

Kolusu Bindu

Hi Everyone,

 

I have been trying to execute my testng.xml file in command prompt window, at the first time I wrote a simple SysOut statement and it executed perfectly fine and then I have added simple java code given below:

package com.vijay.jenkins;

 

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.Test;

 

public class Demo {

              

               @Test

               public void j() 

               {

                              System.out.println("Hi bindu ");

                             

                              System.setProperty("webdriver.chrome.driver", "C:\\Users\\viju4\\Desktop\\selenium\\chromedriver\\chromedriver.exe");

                              WebDriver driver = new ChromeDriver();

                              driver.manage().window().maximize();

                               //Thread.sleep(5000);

                              driver.get("http://www.facebook.com/");

                             

                              System.out.println("The title of the page is "+driver.getTitle());

                              driver.quit();

               }

 

}


i have followed the below commands to execute my testng.xml file in the cmd line:

1.cd F:\Selenium\SampleTestNG

java -cp F:\Selenium\SampleTestNG\lib\*;F:\Selenium\SampleTestNG\bin org.testng.TestNG testng.xml

2.cd F:\Selenium\SampleTestNG

set classpath=F:\Selenium\SampleTestNG\bin;

set classpath=F:\Selenium\SampleTestNG\lib\*;

java org.testng.TestNG testng.xml

 

when I execute the simple test case using these commands worked fine but when I tried to execute the selenium code given above it is throwing an error, please see the attachment for error.


Thanks in advance,

Bindu


 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/dd6fa504-67d9-433f-9d28-f796a77d530f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Demo.java (626 bytes) Download Attachment
Screenshot (125).png (39K) Download Attachment