- Timestamp:
- 09/02/11 14:27:19 (13 years ago)
- Location:
- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/common/HomePage.java
r4917 r5025 28 28 */ 29 29 public void enterMail() { 30 mail.click();30 super.findAndClickElement(By.xpath("//a/img[@id='expressoMail12id']")); 31 31 waitForElement(By 32 32 .xpath("//table[@id='folders_tbl']/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span")); -
devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/common/Page.java
r4962 r5025 53 53 */ 54 54 public void waitForElement(By by) { 55 isDisplayed(this.waitFindElement(by, 10000 , 1000));55 isDisplayed(this.waitFindElement(by, 100000, 1000)); 56 56 } 57 57 … … 200 200 } 201 201 202 public List<WebElement> getComboElements(WebElement element) { 203 return element.findElements(By.tagName("option")); 204 } 205 206 /** 207 * Seleciona todos os valores de um combo. 208 * 209 * @param element 210 */ 211 public void selectAllComboValue(WebElement element) { 212 List<WebElement> options = element.findElements(By.tagName("option")); 213 for (WebElement option : options) { 214 option.setSelected(); 215 } 216 } 217 218 /** 219 * Verifica se o valor passado esta presente na combo box. 220 * 221 * @param element 222 * Elemento a verificar. 223 * @param value 224 * Valor a verificar. 225 * @param select 226 * Se <code>true</code> seleciona o elemento. 227 * @return 228 */ 229 public boolean isValueInCombo(WebElement element, String value, 230 Boolean select) { 231 232 boolean found = false; 233 try { 234 List<WebElement> options = element.findElements(By 235 .tagName("option")); 236 for (WebElement option : options) { 237 if (option.getText().equals(value)) { 238 found = true; 239 if (select) { 240 option.setSelected(); 241 } 242 243 } 244 } 245 } catch (NoSuchElementException nsee) { 246 System.out.println("Warning: ELEMENTO NAO ENCONTRADO!"); 247 found = false; 248 } 249 250 // TODO Rever o tratamento da excecao quando um valor nao for encontrado 251 // na combobox. 252 253 try { 254 throw new Exception("Valor " + value + " não encontrado em " 255 + element); 256 } catch (Exception e) { 257 // TODO Auto-generated catch block 258 e.printStackTrace(); 259 } 260 return found; 261 } 262 202 263 /** 203 264 * Verifica se um element esta presente na tela.
Note: See TracChangeset
for help on using the changeset viewer.