-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathWebDriverOptions.cs
45 lines (34 loc) · 1.52 KB
/
WebDriverOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Drawing;
using System.Net;
namespace Gsemac.Net.WebDrivers {
public class WebDriverOptions :
IWebDriverOptions {
public Uri Uri { get; set; }
public IWebProxy Proxy { get; set; } = WebRequestUtilities.GetDefaultWebProxy();
public TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds(30);
public string UserAgent { get; set; }
public string WebDriverExecutablePath { get; set; }
public bool Headless { get; set; } = false;
public Point WindowPosition { get; set; } = new Point(0, 0);
public Size WindowSize { get; set; } = new Size(1024, 768);
public PageLoadStrategy PageLoadStrategy { get; set; } = PageLoadStrategy.Default;
public bool DisablePopUps { get; set; } = false;
public bool Stealth { get; set; } = false;
public static WebDriverOptions Default => new WebDriverOptions();
public WebDriverOptions() { }
public WebDriverOptions(IWebDriverOptions options) {
Uri = options.Uri;
Proxy = options.Proxy;
Timeout = options.Timeout;
UserAgent = options.UserAgent;
WebDriverExecutablePath = options.WebDriverExecutablePath;
Headless = options.Headless;
WindowPosition = options.WindowPosition;
WindowSize = options.WindowSize;
PageLoadStrategy = options.PageLoadStrategy;
DisablePopUps = options.DisablePopUps;
Stealth = options.Stealth;
}
}
}