HI Team,
As of now iam using windows machine and developed some scripts and executed -- everything works fine in this scenario
but when i try to execute same scripts in Linux machine (Linux machine-- with out GUI only command line we have) scripts are not executing.
Procedure followed to execute scripts in linux machine:
1. Maintained all jars(TestNG and Selenium Stand alone) in lib folder
2. I have used Phantom JS which is used for Headless browser for testing
Sample java code but not the exact app elements:
File file = new File("path of pahntomjs driver");
System.setProperty("phantomjs.binary.path", file.getAbsolutePath());
WebDriver driver = new PhantomJSDriver();
driver.manage().window().setSize(new Dimension(1400,1000));
driver.manage().deleteAllCookies();
driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.findElement(By.xpath("//*[@id="lst-ib"]")).sendKeys("Test");
driver.findElement(By.name("btnK")).click();
Thread.sleep(3000);
driver.close();
Note: Executed above scripts in windows it worked fine but where as in Linux command line it is not executing and getting below error.
Error message: errorMessage":"Unable to find element with xpath '//input[@id='pt1:_pt_it1::content']'"
Executed below lines of statements in putty (command linux server):
javac -classpath "/tmp/SeleniumUsecases/lib/*" -d ./bin ./src/Testcases/*.java
java -classpath /tmp/SeleniumUsecases/lib/*:/tmp/SeleniumUsecases/bin org.testng.TestNG /tmp/SeleniumUsecases/testng.xml
Please provide any inputs on this
Thanks in Advance.