Maven local build is success but from Jenkins its failure for chrome

301 views
Skip to first unread message

karuna nidhi

unread,
Sep 4, 2018, 4:06:08 AM9/4/18
to seleniu...@googlegroups.com
HI All,


I have tried to execute the test cases from jenkins but its got failure.

Error: 

Starting ChromeDriver 2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e) on port 16382
Only local connections are allowed.
Sep 04, 2018 1:19:00 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
The title is:xxxxxxx
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 46.991 s <<< FAILURE! - in TestSuite
[ERROR] TNPSecurity(com.tieroneoss.TNPUsercontrol)  Time elapsed: 38.221 s  <<< FAILURE!
org.openqa.selenium.NoSuchElementException: 
no such element: Unable to locate element: {"method":"id","selector":"j_username"}

but its running successfully from maven.


My POM values are:

<modelVersion>4.0.0</modelVersion>
<groupId>com.tnp</groupId>
<artifactId>demotesting</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demotestingwithtestng</name>
<description>demotestingwithtestng</description>


<dependencies>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>3.14.0</version>
</dependency>


<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5.2</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.13.0</version>
</dependency>


<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.13.0</version>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>3.13.0</version>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-ie-driver</artifactId>
<version>3.13.0</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>compile</scope>
</dependency>

</dependencies>

<build>

<resources>
<resource>
<directory>demotesting/src/main/resources/META-INF/services</directory>
</resource>
</resources>

<plugins>



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>TNPUsercontrol</mainClass>

</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>



</project>






Thanks & Regards,
Karunanidhi.E
9994789611/9443038011

Rajeev Rahi

unread,
Sep 4, 2018, 4:14:30 AM9/4/18
to seleniu...@googlegroups.com
Put some wait after launching the browser. It might be because of the webelement is not getting loaded properly.

--
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 selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAPVy0jdE9Hzx90L9wuhxjYVWijyQ0K374smzTEC4V9fYCckEdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

karuna nidhi

unread,
Sep 4, 2018, 4:25:27 AM9/4/18
to seleniu...@googlegroups.com
I have set the time is 10 sec bro... but still am getting same error.







Thanks & Regards,
Karunanidhi.E
9994789611/9443038011

karuna nidhi

unread,
Sep 4, 2018, 4:25:58 AM9/4/18
to seleniu...@googlegroups.com
I have used the below time condition.

driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS) ;







Thanks & Regards,
Karunanidhi.E
9994789611/9443038011

On Tue, Sep 4, 2018 at 1:44 PM Rajeev Rahi <rajeev...@gmail.com> wrote:

Rajeev Rahi

unread,
Sep 4, 2018, 4:32:15 AM9/4/18
to seleniu...@googlegroups.com
You are using explicit wait or implicit wait? If implicit try using explicit as implicit is uniform for entire page and sometimes it is not sufficient for page to load properly.

karuna nidhi

unread,
Sep 4, 2018, 5:26:32 AM9/4/18
to seleniu...@googlegroups.com
Thread.sleep(10000); is enough?







Thanks & Regards,
Karunanidhi.E
9994789611/9443038011

Rajeev Rahi

unread,
Sep 4, 2018, 5:49:30 AM9/4/18
to seleniu...@googlegroups.com

karuna nidhi

unread,
Sep 4, 2018, 9:03:34 AM9/4/18
to seleniu...@googlegroups.com
But I am still facing issue bro...







Thanks & Regards,
Karunanidhi.E
9994789611/9443038011

Reply all
Reply to author
Forward
0 new messages