1
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?

1
  • Please check your spelling before posting. Also, where are you calling Selenium object from that is multithreaded? Commented Mar 17, 2011 at 18:08

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

No.There is only one instance of ISelenium. and only 1 browser that opens. in this window that I am testing there are multple tabs. for each tab you need to click on tab and check what is inside the windows's tab. so I need threads that every thread is click on its own tab and check the data every several minutes.
Why don't you check them sequentially or as part of different tests? What exactly do you mean by check the data every several minutes?
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.