Reputation: 153
public static ISelenium s;
I access the s
object through multiple threads but doing so causes problems and errors.
It looks like you cannot access the selenium object twice. Whenever I try to use IsElementExist
it fails to find it and says that the startIndex
is larger than the string size.
Any idea how I can get around this?
Upvotes: 1
Views: 847
Reputation: 3496
Seeing the exception you encounter I can't say more. But I suggest to not declare selenium object as static. I used to run in to concurrency issues when used it along with "parallel" mechanism of TestNG.
Upvotes: 0
Reputation: 2155
Are you using your own threads to make concurrent tests? You shouldn't do that, you can use Selenium's built in parallel testing abilities by setting up a selenium Grid and a bunch of selenium RCs and sending the Grid's hub your test requests.
When configuring that you can set the number of "threads" and the parallelism type you want to work with.
Upvotes: 3