1

I have the following problem:

I've created a bunch of test using WebDriver + Java + TestNG + Maven which work just fine when I run them one by one- when the thread-count is 1 in my testng.xml file but when I increase the number of threads the tests start failing, most common issues I am getting are: 1. stale element reference exceptions 2. timeouts 3. keyboard actions do not work in most cases

As for now I am running the tests either just through testng.xml or selenium grid (2.3.1 server) on my local machine using only firefox browser 23.0.1.

Any answer or ideas will be helpful, thanks!

Murzilka
  • 11
  • 1
  • 1
    Can you show how you are creating your webdriver object. Are you storing it in a static variable? Are you running parallel on classes or methods ? Are your instances opening on different machines? – Robbie Wareham Sep 13 '13 at 07:45
  • @RobbieWareham, Here are the answers to your questions: 1. Each test case extends TestTemplate class which has a class variable: protected ThreadLocal threadDriver = null. After I pass a parameter from testng.xml file for each test case, the browser is set through a utils method and the driver is initialized in BeforeClass method: threadDriver.set(new RemoteWebDriver(new URL("http://" + host + ":" + port + "/wd/hub"), capability)). After that I am using the driver instance in the test case. 2. I am running parallel on classes, and here is a piece of my testng.xml: – Murzilka Sep 15 '13 at 01:06
  • ......here I have multiple tests....... – Murzilka Sep 15 '13 at 01:10
  • 3. As for now I am doing the simplest thing: running the tests on localhost machine with only firefox browser. – Murzilka Sep 15 '13 at 01:11

0 Answers0