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
var _driver = new FirefoxDriver(); | |
var wait = new DefaultWait<IWebDriver>(_driver) | |
{ | |
Timeout = TimeSpan.FromSeconds(10), | |
Message = "Dude, where's my element?", | |
PollingInterval = TimeSpan.FromSeconds(1) | |
}; | |
wait.IgnoreExceptionTypes(typeof(NoSuchElementException)); | |
var myElement = wait.Until(ElementIsVisible(elementId)); |
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
namespace OpenQA.Selenium.Support.UI | |
{ | |
// | |
// Summary: | |
// Provides the ability to wait for an arbitrary condition during test execution. | |
public class WebDriverWait : DefaultWait<IWebDriver> | |
{ | |
public WebDriverWait(IWebDriver driver, TimeSpan timeout); | |
public WebDriverWait(IClock clock, IWebDriver driver, TimeSpan timeout, TimeSpan sleepInterval); | |
} |
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 System; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Firefox; | |
using OpenQA.Selenium.Support.UI; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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 System; | |
using NUnit.Framework; | |
using OpenQA.Selenium.Firefox; | |
using OpenQA.Selenium.Support.UI; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Interactions; | |
using System.IO; | |
namespace DragDropTutorial | |
{ |
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 System; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Chrome; | |
using System.Threading; | |
using System.IO; | |
using System.Reflection; | |
namespace Framework | |
{ | |
public enum Drivers |
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 System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Firefox; | |
using OpenQA.Selenium.Support.UI; | |
namespace SeleniumWebdriverTips | |
{ | |
[TestClass] |
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
private IWebDriver GetRemoteDriver() | |
{ | |
//1. Getting the path to my extension | |
var outPutDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | |
ChromeOptions options = new ChromeOptions(); | |
options.AddExtension(outPutDirectory + @"\3.1.3_0.crx"); | |
//2. Adding the appropriate capabilities | |
//---- >>>> Don't do this - Setting the browser name is redundant | |
//options.AddAdditionalCapability(CapabilityType.BrowserName, "chrome", true); |
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
Invoke-WebRequest -URI http://www.bing.com?q=how+many+feet+in+a+mile |
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
Add-Content c:\scripts\test.txt "The End" |
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
Set objFSO=CreateObject("Scripting.FileSystemObject") | |
' How to write file | |
outFile="c:\test\autorun.inf" | |
Set objFile = objFSO.CreateTextFile(outFile,True) | |
objFile.Write "test string" & vbCrLf | |
objFile.Close |