mancocapac
mancocapac

Reputation: 882

Eclipse Run as TestNG String index out of range: -2

TestNG plugin was working fine until yesterday. Now all tests, different classes get the same error. Running either via the class or the individual test. How can I fix this?

An internal error occurred during: "Launching Testing123".
String index out of range: -2

I created the simplest test I could think of and same result:

import org.testng.annotations.Test;

public class Testing123 {

@Test
public void testing() {
  System.out.println("Hello World");
  }
}

NOTE: It does appear to work if I run from a Suite, ie select a suite, right click, Run As TestNG Suite

Environment: mac Eclipse Java EE IDE for Web Developers.

Version: Oxygen.3a Release (4.7.3a) Build id: 20180405-1200 TestNG Plugin: TestNG 6.14.0.201802161500 TestNG = 6.14.x;

Upvotes: 0

Views: 181

Answers (1)

mancocapac
mancocapac

Reputation: 882

See the following:

[String index out of range: -2][https://github.com/cbeust/testng-eclipse/issues/348]

Summary: TestNG provides for a "Template XML file" you can set either at project level or globally. This gives you a way to customize what is done by default when you run tests: Either by Method, Class, or suite inside eclipse.

Problem: If you set the Template XML File value - you MUST have a file there, the current error msg wasn't too clear on what is causing the problem. The Details error msg has been updated and is no much more helpful. In my case, I initially had a file, but later deleted it.

Upvotes: 0

Related Questions