This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String originalHandle = driver.getWindowHandle(); | |
| driver.findElement(ElementsRelatorios.FORM_PDF).click(); | |
| Util.waitLoadingProgress(); | |
| for (String winHandle : driver.getWindowHandles()) { | |
| if (!winHandle.equals(originalHandle)) { | |
| driver.switchTo().window(winHandle); | |
| } | |
| } | |
| System.out.println(driver.getCurrentUrl()); | |
| driver.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (int second = 0;; second++) { | |
| if (second >= 60) { | |
| fail("timeout"); | |
| } | |
| try { | |
| if (isElementPresent(By.cssSelector("#78089_title > li.deleteTitle.listDelete"))) | |
| break; | |
| } catch (Exception e) { | |
| System.out.println(e); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using OpenQA.Selenium; | |
| using OpenQA.Selenium.Interactions; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Assumes TextBox is one of your "tag-specific" element classes. | |
| // Could be RadioButton, or TableCell, or whatever the appropriate | |
| // class is. | |
| // Note that the TextBox class would probably have the MoveTo() | |
| // method you're wanting. | |
| public static TextBox Object1() | |
| { | |
| IWebElement object1 = driver.FindElement(By.Id("txtMyData")); | |
| TextBox myTextBox = new TextBox(object1); | |
| return myTextBox; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using OpenQA.Selenium; | |
| using OpenQA; | |
| using Selenium.Controllers; | |
| namespace Selenium.Controllers | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using OpenQA.Selenium; | |
| using OpenQA; | |
| using Selenium.Controllers; | |
| namespace Selenium.Controllers | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void GetPageRefresh() | |
| { | |
| new Actions(_myApp.Driver) | |
| .KeyDown(Keys.Control).SendKeys("r") | |
| .KeyUp(Keys.Control); | |
| .Perform(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static int ClickNavigate(this IWebElement element, TimeSpan timeout) | |
| { | |
| int responseCode = 0; | |
| string targetUrl = string.Empty; | |
| SessionStateHandler responseHandler = delegate(Session targetSession) | |
| { | |
| // For the first session of the click, the URL should be the URL | |
| // requested by the the element click. | |
| if (string.IsNullOrEmpty(targetUrl)) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public boolean isElementPresent(By by, int indexx) { | |
| //driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); | |
| try { | |
| driver.findElements(by).get(indexx); | |
| return true; | |
| } catch (NoSuchElementException e) { | |
| return false; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| error that i got: | |
| java.lang.NullPointerException | |
| at com.mycompany.PageGeneric.login(PageGeneric.java:36) | |
| at com.mycompany.DemoPageFactory.loginTest(DemoPageFactory.java:41) | |
| */ | |
| //this is my page class | |
| public class PageGeneric { | |
| private WebDriver driver; |
OlderNewer