mercredi 27 juillet 2016

How to tackle when the status of an webelement changes from initial value "xxx" to changed value "yyy" after the page refresh with selenium wait?

This is what i have tried with no luck,
Not sure where i am going wrong?

   if (("xxx").equals(messageStatus)) {      
   FluentWait<WebDriver> wait = new FluentWait<WebDriver> (driver)            
                .withTimeout(90, TimeUnit.SECONDS)                  
                .pollingEvery(500, TimeUnit.MILLISECONDS)            
                .ignoring(NoSuchElementException.class);              

  wait.until(new Function<WebDriver, WebElement>() {      
            public WebElement apply(WebDriver webDriver) {            
           String messageStatus =
  MessageLogPage.messageStatus.getText();            
                if (messageStatus.equals("yyy")){              
                    MessageLogPage.receivedPresentation.click();            
                }      
                    return null;          
                 }                
        });    

Any help/suggestions are much appreciated.Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire