|
Hello all,
This is the circumstance. I am an QA Automation Engineer and right now I am being charged with setting up our CI framework in Jenkins but right now I am having issues with Maven. I am getting this error below when I try to run the mvn test command. However the tests work flawlessly in eclipse when run as maven test.
T E S T S
-------------------------------------------------------
Running TestSuite
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configur
ator@3830f1c0
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configur
ator@bd8db5a
Tests run: 16, Failures: 1, Errors: 0, Skipped: 14, Time elapsed: 0.66 sec <<< F
AILURE!
beforeTest(fcstestingsuite.fsnrgn.LoginTest) Time elapsed: 0.442 sec <<< FAILU
RE!
java.lang.IllegalStateException: The path to the driver executable must be set b
y the webdriver.chrome.driver system property; for more information, see https:/
/github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be dow
nloaded from http://chromedriver.storage.googleapis.com/index.html
at com.google.common.base.Preconditions.checkState(Preconditions.java:19
9)
at org.openqa.selenium.remote.service.DriverService.findExecutable(Drive
rService.java:109)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDrive
rService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExe
cutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(Driver
Service.java:296)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(C
hromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at fcstestingsuite.fsnrgn.LoginTest.beforeTest(LoginTest.java:54)
Results :
Failed tests: beforeTest(fcstestingsuite.fsnrgn.LoginTest): The path to the dr
iver executable must be set by the webdriver.chrome.driver system property; for
more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
The latest version can be downloaded from http://chromedriver.storage.googleapis
.com/index.html
Tests run: 16, Failures: 1, Errors: 0, Skipped:
14
As you can see it is related to my chrome system property/path. In my project I have a test package and page object package. I set my chrome system property in the object class and import that class into the test class which works fine in eclipse. I'm not quite sure why Maven is having an issue with this.
Sample code below
Page Class
package pageobjectfactory;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.FindBy;
import org.testng.Assert;
public class Ourfsnlogin {
@FindBy(id="ctl00_ContentPlaceHolder1_tbxUname")
WebElement login;
@FindBy(id="ctl00_ContentPlaceHolder1_tbxPword")
WebElement password;
@FindBy(id="ctl00_ContentPlaceHolder1_btnSubmit")
WebElement submit;
@FindBy(name="ctl00$ContentPlaceHolder1$rptAccounts$ctl01$AccountSwitch")
WebElement PETSMARTUS;
@FindBy(name="ctl00$ContentPlaceHolder1$rptAccounts$ctl02$AccountSwitch")
WebElement PETSMARTCAD;
@FindBy(name="ctl00$ContentPlaceHolder1$rptAccounts$ctl03$AccountSwitch")
WebElement PETSMARTPR;
@FindBy(id="ctl00_lblTopLogin")
WebElement PETSMARTUSASSERT;
@FindBy(id="ctl00_lblTopLogin")
WebElement PETSMARTCAASSERT;
@FindBy(id="ctl00_lblTopLogin")
WebElement PETSMARTPRASSERT;
@FindBy(id="ctl00_Menu1_16")
WebElement LogoutButton;
public static WebDriver driver;
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","C:\\Users\\dmohamed\\Documents\\Testing Environment\\Testing Environment\\Web Drivers\\chromedriver_win32 (1)\\chromedriver.exe");
WebDriver chromedriver = null; new ChromeDriver();
driver= chromedriver;
}
public void sendUserName(String strUsername){
login.sendKeys("ebluth");}
public void sendUserNameServiceCenter(String strUsername){
login.sendKeys("servicecenter");}
public void sendUserNameSP(String strUsername){
login.sendKeys("4328701");
}
public void sendPassword(String strPassword){
password.sendKeys("password");}
public void clicksubmit(){
submit.click();}
public void USAssertion(){
PETSMARTUS.isEnabled();
}
public void CAAssertion(){
PETSMARTCAD.isEnabled();}
public void PRAssertion(){
PETSMARTPR.isEnabled();}
public void USclick(){
PETSMARTUS.click();
}
public void CAclick(){
PETSMARTCAD.click();}
public void PRclick(){
PETSMARTPR.click();}
public void USPageValidation(){
Assert.assertTrue(PETSMARTUSASSERT.getText().contains("PETM-US"), "Incorrect Page [US,CA,PR]");
}
public void PRPageValidation(){
Assert.assertTrue(PETSMARTPRASSERT.getText().contains("PETM-PR"),"Incorrect Page [US,CA,PR]");
}
public void CAPageValidation(){
Assert.assertTrue(PETSMARTCAASSERT.getText().contains("PETM-CN"),"Incorrect Page [US,CA,PR]");
}
public void Logout (){
LogoutButton.click();
}}
Test Class
package fcstestingsuite.fsnrgn;
import org.testng.annotations.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import pageobjectfactory.Ourfsnlogin;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
public class LoginTest {
static WebDriver driver;
Ourfsnlogin LoginPage;
@Test (priority=1)
public void USPageTest() {
LoginPage.sendUserName("ebluth");
LoginPage.sendPassword("password");
LoginPage.clicksubmit();
LoginPage.USclick();
LoginPage.USPageValidation();
}
@Test(priority=2)
public void CAPageTest(){
LoginPage.sendUserName("ebluth");
LoginPage.sendPassword("password");
LoginPage.clicksubmit();
LoginPage.CAclick();
LoginPage.CAPageValidation();
}
@Test (priority=3)
public void PRPageTest(){
LoginPage.sendUserName("ebluth");
LoginPage.sendPassword("password");
LoginPage.clicksubmit();
LoginPage.PRclick();
LoginPage.PRPageValidation();
}
@AfterMethod
public void aftermethod(){
LoginPage.Logout();
}
@BeforeTest
public void beforeTest() {
Ourfsnlogin.driver=new ChromeDriver();
PageFactory.initElements(new AjaxElementLocatorFactory(driver, 20), this);
Ourfsnlogin.driver.get("http://www.ourfsn.com/myfsn");
LoginPage= PageFactory.initElements(Ourfsnlogin.driver, Ourfsnlogin.class);
}
@AfterTest
public void afterTest() {
Ourfsnlogin.driver.quit();
}
}
Any help would be greatly appreciated
|
|
|
|
|
Remove both Jenkins and Eclipse from the process.
Validate that maven and java are installed on the work box (again neither of those have anything to do with Jenkins nor Eclipse.)
Create new directory.
Extract the entire source tree (repository, whatever) into that new directory.
Open a console window and cd to that new directory.
Run maven from there.
If the above fails, I suspect it will, then development, not QA/Test is responsible for fixing the contents of source control so that it runs. That however is a management problem not a technical problem.
I suspect the above will still fail. And it indicates that the unit tests are not set up correctly in that they are relying on something in eclipse. You probably have to add one or more configuration files.
It is quite possible that the configuration already exists somewhere but it is not accessible in the context in which the tests run. As a suggestion, and only a suggestion, the needed configuration files might be found in the 'primary' directory (wherever the delivered application actually starts to run) and they need to be moved and perhaps even modified into the parent directory where the tests are very likely into '.../src/test/resources' but other locations might be possible as well.
|
|
|
|
|
I try to read TTL file and make traversing get subject, predict and object.
the program compile successfully but no output as a result of entering in an infinite call as I understood. any suggestion for help
package new_try;
import com.hp.hpl.jena.graph.Triple;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.riot.lang.PipedRDFIterator;
import org.apache.jena.riot.lang.PipedRDFStream;
import org.apache.jena.riot.lang.PipedTriplesStream;
public class New_try {
public static void main(String[] args) throws FileNotFoundException {
final String filename = "E:\\yagoTransitiveType.ttl";
System.out.println(filename);
System.out.println("Hello1");
PipedRDFIterator<Triple> iter = new PipedRDFIterator<>();
System.out.println("Hello2");
final PipedRDFStream<Triple> inputStream = new PipedTriplesStream(iter);
System.out.println("Hello3");
ExecutorService executor = Executors.newSingleThreadExecutor();
System.out.println("Hello4");
Runnable parser;
parser = new Runnable() {
@Override
public void run() {
System.out.println(filename);
RDFDataMgr.parse(inputStream, filename);
System.out.println("Hello6");
}
};
executor.submit(parser);
while (iter.hasNext()) {
Triple next = iter.next();
System.out.println("Subject: "+next.getSubject());
System.out.println("Object: "+next.getObject());
System.out.println("Predicate: "+next.getPredicate());
System.out.println("\n");
}
}
}
|
|
|
|
|
|
i have .jar file of my code and i want to convert it into .exe or standalone file which can be run on my of windows system without java installation. please guide me how i can do this. i had tried JSmooth 0.9.9-7 and JexePack . but there exe needs java installation.
|
|
|
|
|
|
Besides what Richard has suggested, my recommendation is don't do this. This would entirely kill the purpose of Java language being used and would be of no good (and benefit) than to use Java over C++ or C#, if the need of the executable is just Windows operating system.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I think Jar2Exe application is going to be the most suitable option here. Though it's kinda' expensive. But it's the best tool for converting jar files into a executive binary files.
|
|
|
|
|
Curry Francis wrote: executive binary files. Only available to management then. 
|
|
|
|
|
Yeah, true. But he didn't mentioned what exactly he wants from it, so.. 
|
|
|
|
|
I guess we need an irony emoji.
|
|
|
|
|
You could roll your own using exactly the same mechanism.
All it does is put the java jars and the VM into a binary for the target platform. When it is executed it starts the VM and feeds the jars to it.
|
|
|
|
|
I want to iterate through the Controls on a form using a For loop to find the JLists then create an array of the selected items on certain JLists by JList name hopefully
In vb I would do something like:
For each ctrl in me.controls
if ctrl.name="abc" then
[do something]
end if
Next
|
|
|
|
|
|
Thanks, was simpler than I thought.
Had tried searching, just should have thought a bit more about what i was searching for, it was a long night.
|
|
|
|
|
Given your question, what else could you search for?
|
|
|
|
|
hi,
i'm an experienced C++ , C# and Python programmer. Now i'm thinking of learning java (i know the basics though).
But i'm wondering what will be the use of that... i know Java is pretty popular, but it cannot run without JRE (i.e. it does not support standalone executables) and the source code is also visible (even you can extract the .jar files and view the source code).I'm also an opengl programmer (with C++), and i've seen some opengl game tutorials with java, so the question arises that where those games will be played.. ive never seen a game with .jar executable.Im also known to the popular SWING toolkit, but where are those SWING apps used, i've never seen one. So i want to know the main purpose of learning java. And i've also got my environment ready with JDK and eclipse. 
|
|
|
|
|
Ratul Thakur wrote: So i want to know the main purpose of learning java. The same purpose as learning any language: to develop applications. Whether for your own amusement, or as a requirement of your employment, is up to you to choose.
|
|
|
|
|
no no... i dont need employement im just 15,
i mean ... .... well... i want to know that if i create a GUI app on swing, where will that be used?? ..ive never seen a commercial app developed in swing, neither a 3D opengl game in the .jar file format. Or is there a way to make platform specific binary executables??
Thanks for your help!
|
|
|
|
|
Ratul Thakur wrote: if i create a GUI app on swing, where will that be used? Anywhere that you can get people to use it.
Ratul Thakur wrote: is there a way to make platform specific binary executables? No need, java is write once, run anywhere.
|
|
|
|
|
thanks mate, i searched google... and i think my main purpose of learning java is going to be android developement
getting started now!! ive got a pdf from tutorialspoint.com .
|
|
|
|
|
|
Most platforms have the JVM installed, so it's not necessary to make an executable. You can make a standalone executable if you want, but you will loose Java's portability.
Releated stack overflow question.
Instead of Swing you should the newer GUI library, JavaFX. As far as games go, LWJGL is used for making games in Java. Minecraft was originally written in Java.
|
|
|
|
|
thanks
i've completed half of the book on java programming.... and i find this language great. And then i'm planning to learn JavaFX and then probably OpenGL with java for android developement.
|
|
|
|
|
These are the reasons that I personally came up with:
Java has a very rich API, and an incredible supporting open source ecosystem. There are tools upon tools for just about everything you would like to do.
Java is an Object Oriented language. It internally embraces best practices of object oriented design.
The IDEs available for Java will blow your mind.
Java is running just about everywhere you can imagine. It’s usually where most large applications end up due to its scalability, stability, and maintainability.
All Android Apps are written in Java.
Java is a verbose language, which at first can seem daunting. However, after learning the basics you’ll find that you can easily grab onto more advanced concepts because the code is very explicit.
Hope it will help you!
|
|
|
|