Implicitewait should be a generic method in testbase class? | Selenium Forum
M
Posted on 27/04/2016
The scenario u discussed: Login to rediff.com
[b:1xz1f7qk]Query: Should there be a generic method in testbase class for implicitwait ?
Please check below code[A element needs to be implicitly waited upon before clicking it][/b:1xz1f7qk]
//**************************************************************************

Have the following code:

@Test(dataProvider="getTestData")
public void testcaseB4chai(
String username,
String password,
String browser,
String ExpectedResult
){
// test the runmode of current dataset
count++;
if(!runmodes[count].equalsIgnoreCase("Y")){
throw new SkipException("Runmode for test set data set to no "+count);
}
APP_LOGS.debug(" Executing TestCase_B4_chai");
APP_LOGS.debug(username +" -- "+password +" -- "+browser +" -- "+ExpectedResult);
/*******************webDriver calls*********************************/

openBrowser(browser);
Navigate("Url_Navigate_To");
[b:1xz1f7qk]click("Money_Id");[/b:1xz1f7qk]//------------[b:1xz1f7qk]------------->This requires implicit wait to be used for util.elementvisible[/b:1xz1f7qk]
click("SigIn_LinkText");
input("EmailField_Id",username);



}

M
Replied on 27/04/2016

[quote:11up4rdp]Should there be a generic method in testbase class for implicitwait[/quote:11up4rdp]

yeah if you want you can create generic class.


or you can put this

[code:11up4rdp]Navigate("Url_Navigate_To");
driver.manage.implicit wait;
click("Money_Id");//------------------------->This requires implicit wait to be used for util.elementvisible
click("SigIn_LinkText");
[/code:11up4rdp]