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
using OpenQA.Selenium; | |
using OpenQA.Selenium.Support.UI; | |
using System; | |
using System.Drawing.Imaging; | |
namespace Richard.WebDriverExtensions | |
{ | |
public static class WebDriverExtensions | |
{ | |
/// <summary> |
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.TakeScreenshot(@"C:\Temp\Richard.jpeg", 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 void ProxyUsingFirefoxDriver() | |
{ | |
//Create a new Firefox profile | |
FirefoxProfile firefoxProfile = new FirefoxProfile(); | |
//Then add the proxy setting to the Firefox profile we created | |
firefoxProfile.setPreference("network.proxy.http", "localhost"); | |
firefoxProfile.setPreference("network.proxy.http_port", "8888"); | |
//Then create a new Firefox Driver passing in the profile we created | |
//WebDriver we open a Firefox using this profile now | |
FirefoxDriver Driver = new FirefoxDriver(firefoxProfile); |
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 void ProxyUsingChromeDriver() | |
{ | |
//Set the location of the ChromeDriver | |
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Richard\\Desktop\\chromedriver.exe"); | |
//Create a new desired capability | |
DesiredCapabilities capabilities = DesiredCapabilities.chrome(); | |
// Create a new proxy object and set the proxy | |
Proxy proxy = new Proxy(); | |
proxy.setHttpProxy("localhost:8888"); | |
//Add the proxy to our 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
So these are all the postits note I could find after the LeanBaconTeaCoffee at TestBash. | |
It was suggested by an attendee that these could make could help people formulate some blog ideas | |
so here they are! | |
1. Release candidate testing | |
2. Are unit checks only for programmers | |
3. When does a tester become a developer | |
4. Sustainable pace | |
5. Ant fucking (nit picking) how picky is it OK to be with testing? | |
6. Is there a way to inspire 9-5 testers? |
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 User | |
{ | |
private String firstName; | |
private String surname; | |
private int age; | |
private String emailAddress; | |
} | |
//Then you could do the following | |
public void setFirstName(String firstName) |
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; |
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; |
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 UserChecks | |
{ | |
public void DataCreation() | |
{ | |
User user = UserBuilder().buildGenericUser(); | |
user.setSurname("Richards"); | |
user.setAge(35); | |
UserCreator.create(user); | |
} | |
} |
OlderNewer