Ignore:
Timestamp:
07/18/11 10:56:36 (13 years ago)
Author:
luiz-fernando
Message:

Ticket #1771 - Refactoring, criadas novas classes para Pasta, Filtro, Pesquisa

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/common/Page.java

    r4620 r4780  
    146146         *            Valor a ser selecionado. 
    147147         */ 
    148         public void setComboValue(WebElement element, String value) { 
    149                 List<WebElement> options = element.findElements(By.tagName("option")); 
    150                 for (WebElement option : options) { 
    151                         if (option.getText().equals(value)) { 
    152                                 option.setSelected(); 
    153                                 return; 
    154                         } 
     148        public boolean setComboValue(WebElement element, String value) { 
     149 
     150                try { 
     151                        List<WebElement> options = element.findElements(By 
     152                                        .tagName("option")); 
     153                        for (WebElement option : options) { 
     154                                if (option.getText().equals(value)) { 
     155                                        option.setSelected(); 
     156                                        return true; 
     157                                } 
     158                        } 
     159                } catch (NoSuchElementException nsee) { 
     160                        System.out.println("Warning: ELEMENTO NAO ENCONTRADO!"); 
     161                        return false; 
    155162                } 
    156163 
     
    165172                        e.printStackTrace(); 
    166173                } 
     174                return false; 
    167175        } 
    168176 
     
    177185        } 
    178186 
     187        /** 
     188         * Verifica se um element esta presente na tela. 
     189         *  
     190         * @param by 
     191         * @return 
     192         */ 
     193        public Boolean isElementPresent(By by) { 
     194                boolean find = true; 
     195                try { 
     196                        driver.findElement(by); 
     197                } catch (NoSuchElementException nsee) { 
     198                        find = false; 
     199                } 
     200                return find; 
     201        } 
     202 
    179203} 
Note: See TracChangeset for help on using the changeset viewer.