Skip to content

Instantly share code, notes, and snippets.

View krmahadevan's full-sized avatar
☠️
Threading ain't hard… Locking is!

Krishnan Mahadevan krmahadevan

☠️
Threading ain't hard… Locking is!
View GitHub Profile
package com.rationaleemotions;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class SampleTest {
package com.rationaleemotions.stackoverflow.qn45484794;
import org.testng.annotations.AfterMethod;
import java.util.LinkedList;
import java.util.List;
public abstract class AbstractTest {
public static List<String> messages = new LinkedList<>();
package com.rationaleemotions.stackoverflow.qn44518748;
import org.testng.Reporter;
import org.testng.annotations.Test;
public class SampleClassOne {
@Test
public void testMethodA() {
Reporter.log("Executing : " + output(), true);
}
1
Retrying test test with status FAILURE for the 1 time(s).
Test ignored.
java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
@krmahadevan
krmahadevan / ConsoleLogs.txt
Created March 11, 2017 03:28
The Node configuration file that I used.
java -jar selenium-server-standalone-3.3.0.jar -role node -hub http://localhost:4444/grid/register -nodeConfig NodeConfig.json -debug true
08:57:28.622 INFO - Selenium build info: version: '3.3.0', revision: 'b526bd5'
08:57:28.623 INFO - Launching a Selenium Grid node
08:57:30.432 DEBUG - CookieSpec selected: default
08:57:30.443 DEBUG - Auth cache not set in the context
08:57:30.444 DEBUG - Connection request: [route: {}->http://localhost:4444][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
08:57:30.549 DEBUG - Connection leased: [id: 0][route: {}->http://localhost:4444][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
08:57:30.550 DEBUG - Opening connection {}->http://localhost:4444
08:57:30.601 DEBUG - Connecting to localhost/127.0.0.1:4444
08:57:30.613 DEBUG - Connect to localhost/127.0.0.1:4444 timed out. Connection will be retried using another IP address
package com.rationaleemotions.stackoverflow;
import org.testng.annotations.Test;
public class ChildClassOne extends MyBaseClass {
public ChildClassOne() {
super(false);
}
@Test
<?xml version="1.0" encoding="utf-8"?>
<testsuite name="str1234" time="str1234" tests="str1234" errors="str1234" skipped="str1234" failures="str1234" group="str1234">
<properties>
<property name="str1234" value="str1234" />
</properties>
<testcase name="str1234" classname="str1234" group="str1234" time="str1234">
<failure message="str1234" type="str1234" time="str1234">str1234</failure>
<rerunFailure message="str1234" type="str1234" time="str1234">str1234</rerunFailure>
<skipped message="str1234">str1234</skipped>
<error message="str1234" type="str1234">str1234</error>
@krmahadevan
krmahadevan / pom.xml
Created November 9, 2016 05:00
Cleaned up pom file
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>vam5</groupId>
<artifactId>vam5</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>vam5</name>
<packaging>jar</packaging>
<properties>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
@krmahadevan
krmahadevan / GroupTest.java
Created October 27, 2016 04:52
How to execute selective methods from a group using Beanshell in TestNG
package org.rationale.emotions;
import org.testng.annotations.Test;
public class GroupTest {
@Test(groups = "dragon-lord")
public void foo() {
System.err.println("foo() says hello");
}
@krmahadevan
krmahadevan / Execution_Output.txt
Created October 27, 2016 04:06
Use Data Provider in Test Scenario [ Sample that backs my response for the SO thread : http://stackoverflow.com/a/40199773/679824
...
... TestNG 6.9.13.8 by Cédric Beust (cedric@beust.com)
...
[TestNG] Running:
/Users/krmahadevan/githome/PlayGround/playSelenium/src/test/resources/factory.xml
TestClass.testOne()
TestClass.testTwo()
TestClass.testOne()
TestClass.testTwo()