Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void E_WaitUntilElementDisplay() throws Exception
- {
- int i=1;
- boolean eleche,eleche1 = false;
- while(i<=1)
- {
- try{
- eleche = driver.findElements(by.xpath("path")).size()!=0;
- }catch(InvalidSelectorException ISExcep)
- {
- eleche = false;
- }
- if(eleche == true)
- {
- while(i<=1)
- {
- try{
- eleche1=driver.findElement(By.xpath("Path")).isDisplayed();
- }catch(org.openqa.selenium.NoSuchElementException NSEE){
- eleche1=false;
- }
- if(eleche1 == true)
- {
- i=2;
- System.out.println("\nElement Displayed.");
- }
- else
- {
- i=1;
- Thread.sleep(1500);
- System.out.println("\nWaiting for element, to display.");
- }
- }
- }
- else
- {
- i=1;
- Thread.sleep(1500);
- System.out.println("\nWaiting for element, to display.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement