Tech Support Guy banner
Status
Not open for further replies.
1 - 2 of 2 Posts

·
Registered
Joined
·
2 Posts
Discussion Starter · #1 ·
Hi all,

I'm getting issue in starting selenium. Actually my thread class has selenium.start() in run() method. So when I'm using below lines of code,

//some another class
class someclass{

ScrapeThread nidleThread = new ScrapeThread("nidleThread");
Thread scraper = new Thread(niidleThread);
scraper.start()
}

as thread.start() method internally calls run() method, so in run() method of thread class only first two three lines of code are getting executed and when it executes comes to selenium.start() and executes, then selenium is giving issue in starting means I can see only two commands getting executed in command history of selenium remote and then getting struck there.

But when i m using below code and directly calling the run() method of my thread class

//some another class
class someclass{
ScrapeThread nidleThread = new ScrapeThread("nidleThread");
nidleThread.run();
}
here it's working properly and I'm getting proper output as I want.

What could be the issue in starting selenium when I'm executing the thread in normal way i.e. by calling scrapper.start() method?

//in thread class
run(){
selenium = new DefaultSelenium(config.getHost(), Integer.parseInt(config.getPort()), config.getBrowser(), config.getUrl());
selenium.start();
}


Thanks in advance
Saggy
 
1 - 2 of 2 Posts
Status
Not open for further replies.
Top