Hi
i am doing a similar kind of thing but while running test cases in parallel my execution fails
what i am doing is as an example
i have BaseTest class which sets itestcontext.setattribute("driver",new chromedriver()) under beforeemethod and in aftermethod i remove that attribute , however in testclasses i have multiple tests and i am using webdriver by taking it from like
@test()
public void test1(itestcontext itestcontext){
webdriver driver = (webdriver)itestcontext.getattribute("driver");
//and subsequently using it in my page object classes
}
@test()
public void test2(itestcontext itestcontext){
webdriver driver = (webdriver)itestcontext.getattribute("driver");
//and subsequently using it in my page object classes
}
@test()
public void test3(itestcontext itestcontext){
webdriver driver = (webdriver)itestcontext.getattribute("driver");
//and subsequently using it in my page object classes
}
my test cases are running fine in serial order , but while parallel execution, it fails and getting error like sessionnotfound, or unable to connect webdriverexception. could you please help me out on this.
you can check out the demoproject in given repository. adding a url
On Monday, February 19, 2018 at 3:54:40 PM UTC+5:30 Krishnan Mahadevan wrote:
ITestContext is shared by one or more @Test methods that are part of the same <test> tag.