1) method Driver1 Call:
1 @BeforeClass 2 Public void throws Exception {3 // Startup Scripts 4 5 // Launch Browser 6 Driver (Config.browserpath, config.browserdriverpath); 7 Driver1 (CONFIG.WEBURL1); 8 }
2) method Driver1 implementation, in the method using the display wait, the code is as follows:
1 //opens the specified URL2 Public StaticWebelement Driver1 (String webUrl)throwsException {3 //let the browser access the Web4Debug ("URL:" +WEBURL); 5 Driver.get (WEBURL);6Webelement e = (NewWebdriverwait (Driver, 10). Until (7 Newexpectedcondition< webelement>(){ 8 Publicwebelement Apply (webdriver d) {9 returnD.findelement (By.xpath (".//*[@id = ' Test-top-tab ']/table/tbody/tr/td[1]/table/tbody/tr/td[1]/table/tbody/tr/td[2 ]" ));Ten } One }); A //gets the title of the page -Log ("Open page:" +driver.gettitle ()); - returne; the}
Wait for page Load method