This file contains 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 abstract class DefaultPage | |
{ | |
protected IWebDriver WebDriver { get; set; } | |
public LynxDefaultPage(IWebDriver webDriver) | |
{ | |
WebDriver = webDriver; | |
} | |
} |
This file contains 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
webDriver = new ScreenShotRemoteWebDriver(new Uri(remoteServer), capabilities); |
This file contains 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
Screenshot ss = ((ITakesScreenshot)webDriver).GetScreenshot(); | |
string screenshot = ss.AsBase64EncodedString; | |
byte[] screenshotAsByteArray = ss.AsByteArray; | |
ss.SaveAsFile(@"C:\Temp", System.Drawing.Imaging.ImageFormat.Jpeg); |
This file contains 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 class ScreenShotRemoteWebDriver : RemoteWebDriver, ITakesScreenshot | |
{ | |
public ScreenShotRemoteWebDriver(Uri remoteAddress, ICapabilities desiredCapabilities) | |
: base(remoteAddress, desiredCapabilities) | |
{ | |
} | |
public Screenshot GetScreenshot() | |
{ | |
// Get the screenshot as base64. |
This file contains 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
return requiredRow.FindElement(By.XPath(string.Format("td[{0}]", FindColumnIndex(columnName)))); |
This file contains 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
try | |
{ | |
requiredRow = _tableRows.First(d => d.FindElement(By.XPath(string.Format("td[{1}"]))).Text == knownValue); | |
} |
This file contains 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 class UserBuilder | |
{ | |
private User; | |
public UserBuilder() | |
{ | |
User = new User(); | |
user.setFirstName("Richard"); | |
user.setSurname("Bradshaw"); | |
user.setAge(29); |
This file contains 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 UserChecks | |
{ | |
public void DataCreation() | |
{ | |
User user = UserBuilder().buildGenericUser(); | |
user.setSurname("Richards"); | |
user.setAge(35); | |
UserCreator.create(user); | |
} | |
} |
This file contains 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 UserChecks | |
{ | |
public void DataCreation() | |
{ | |
User user = UserBuilder().buildGenericUser(); | |
user.setSurname("Richards"); | |
user.setAge(35); | |
} | |
} |
This file contains 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 class UserBuilder | |
{ | |
public User buildGenericUser() | |
{ | |
User user = new User(); | |
user.setFirstName("Richard"); | |
user.setSurname("Bradshaw"); | |
user.setAge(29); | |
user.setEmailAddress("richard@richard.com"); | |
return user; |