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
<ItemGroup> | |
<PackageReference Include="Appium.WebDriver" Version="4.1.1" /> | |
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" /> | |
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" /> | |
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" /> | |
</ItemGroup> |
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
{ | |
"chrome": { | |
"default": "mobile-79.0", | |
"versions": { | |
"mobile-79.0": { | |
"image": "selenoid/chrome-mobile:79.0", | |
"port": "4444", | |
"path": "/wd/hub" | |
} | |
} |
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
[Test] | |
public void TestChromeExecutionTime() | |
{ | |
Profile | |
( | |
"TestChromeExecutionTime", | |
10, | |
() => | |
{ | |
using (IWebDriver driver = new ChromeDriver()) |
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
var edgeDriverService = Microsoft.Edge.SeleniumTools.EdgeDriverService.CreateChromiumService(); | |
var edgeOptions = new Microsoft.Edge.SeleniumTools.EdgeOptions(); | |
edgeOptions.PageLoadStrategy = PageLoadStrategy.Normal; | |
edgeOptions.UseChromium = true; | |
edgeOptions.AddArguments("--headless"); | |
using (IWebDriver driver = new Microsoft.Edge.SeleniumTools.EdgeDriver(edgeDriverService, edgeOptions)) | |
{ | |
PerformTestOperations(driver); | |
} |
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
[TestClass] | |
public class CaptureHttpTrafficDevToolsTests | |
{ | |
private ChromeDriver _driver; | |
[TestInitialize] | |
public void TestInitialize() | |
{ | |
_driver = new ChromeDriver(); | |
} |
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
[TestClass] | |
public class CaptureHttpTrafficTests | |
{ | |
private static IWebDriver _driver; | |
private static ProxyServer _proxyServer; | |
private static IDictionary<int, Proxy.Request> _requestsHistory; | |
private static IDictionary<int, Proxy.Response> _responsesHistory; | |
private static ConcurrentBag<string> _blockUrls; | |
[ClassInitialize] |
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
_driver.SwitchTo().NewWindow(WindowType.Tab); | |
_driver.SwitchTo().NewWindow(WindowType.Window); | |
_driver.SwitchTo().ParentFrame(); |
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
_driver.SwitchTo().ParentFrame(); |
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
var setExtraHTTPHeadersCommandSettings = new SetExtraHTTPHeadersCommandSettings(); | |
setExtraHTTPHeadersCommandSettings.Headers.Add("Accept-Encoding", "gzip, deflate"); | |
devToolssession.Network.SetExtraHTTPHeaders(setExtraHTTPHeadersCommandSettings); |
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
EventHandler<RequestInterceptedEventArgs> requestIntercepted = (sender, e) => | |
{ | |
Assert.IsTrue(e.Request.Url.EndsWith("jpg")); | |
}; | |
RequestPattern requestPattern = new RequestPattern(); | |
requestPattern.InterceptionStage = InterceptionStage.HeadersReceived; | |
requestPattern.ResourceType = ResourceType.Image; | |
requestPattern.UrlPattern = "*.jpg"; | |
var setRequestInterceptionCommandSettings = new SetRequestInterceptionCommandSettings(); |