diff --git a/dotnet/src/webdriver/DevTools/Target.cs b/dotnet/src/webdriver/DevTools/Target.cs index 1a77fe22140a8..3bace60cb97b0 100644 --- a/dotnet/src/webdriver/DevTools/Target.cs +++ b/dotnet/src/webdriver/DevTools/Target.cs @@ -40,7 +40,7 @@ public abstract class Target /// contains the list of objects describing the /// targets available for this session. /// - public abstract Task> GetTargets(); + public abstract Task> GetTargets(Object settings = null); /// /// Asynchronously attaches to a target. diff --git a/dotnet/src/webdriver/DevTools/v105/V105Target.cs b/dotnet/src/webdriver/DevTools/v105/V105Target.cs index ed68c072861da..911b11981ecdc 100644 --- a/dotnet/src/webdriver/DevTools/v105/V105Target.cs +++ b/dotnet/src/webdriver/DevTools/v105/V105Target.cs @@ -50,7 +50,7 @@ public V105Target(TargetAdapter adapter) /// contains the list of objects describing the /// targets available for this session. /// - public override async Task> GetTargets() + public override async Task> GetTargets(Object settings = null) { List targets = new List(); var response = await adapter.GetTargets(); diff --git a/dotnet/src/webdriver/DevTools/v106/V106Target.cs b/dotnet/src/webdriver/DevTools/v106/V106Target.cs index 49b7e2af599ae..9758330bca3ee 100644 --- a/dotnet/src/webdriver/DevTools/v106/V106Target.cs +++ b/dotnet/src/webdriver/DevTools/v106/V106Target.cs @@ -50,11 +50,15 @@ public V106Target(TargetAdapter adapter) /// contains the list of objects describing the /// targets available for this session. /// - public override async Task> GetTargets() + public override async Task> GetTargets(Object settings = null) { List targets = new List(); - var response = await adapter.GetTargets(new GetTargetsCommandSettings()); + if (settings == null) + { + settings = new GetTargetsCommandSettings(); + } + var response = await adapter.GetTargets((GetTargetsCommandSettings) settings); for (int i = 0; i < response.TargetInfos.Length; i++) { var targetInfo = response.TargetInfos[i]; diff --git a/dotnet/src/webdriver/DevTools/v107/V107Target.cs b/dotnet/src/webdriver/DevTools/v107/V107Target.cs index 3bc158eff50d7..addec93b978a2 100644 --- a/dotnet/src/webdriver/DevTools/v107/V107Target.cs +++ b/dotnet/src/webdriver/DevTools/v107/V107Target.cs @@ -50,11 +50,15 @@ public V107Target(TargetAdapter adapter) /// contains the list of objects describing the /// targets available for this session. /// - public override async Task> GetTargets() + public override async Task> GetTargets(Object settings = null) { List targets = new List(); - var response = await adapter.GetTargets(new GetTargetsCommandSettings()); + if (settings == null) + { + settings = new GetTargetsCommandSettings(); + } + var response = await adapter.GetTargets((GetTargetsCommandSettings) settings); for (int i = 0; i < response.TargetInfos.Length; i++) { var targetInfo = response.TargetInfos[i]; diff --git a/dotnet/src/webdriver/DevTools/v85/V85Target.cs b/dotnet/src/webdriver/DevTools/v85/V85Target.cs index 8650e87359783..3de3a4a0837e9 100644 --- a/dotnet/src/webdriver/DevTools/v85/V85Target.cs +++ b/dotnet/src/webdriver/DevTools/v85/V85Target.cs @@ -50,7 +50,7 @@ public V85Target(TargetAdapter adapter) /// contains the list of objects describing the /// targets available for this session. /// - public override async Task> GetTargets() + public override async Task> GetTargets(Object settings = null) { List targets = new List(); var response = await adapter.GetTargets(); diff --git a/dotnet/test/common/DevTools/DevToolsTargetTest.cs b/dotnet/test/common/DevTools/DevToolsTargetTest.cs index 4215137c31c53..d053caa6d885b 100644 --- a/dotnet/test/common/DevTools/DevToolsTargetTest.cs +++ b/dotnet/test/common/DevTools/DevToolsTargetTest.cs @@ -1,10 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; using NUnit.Framework; +using OpenQA.Selenium.DevTools.V107.Target; using OpenQA.Selenium.Environment; namespace OpenQA.Selenium.DevTools @@ -22,7 +20,7 @@ public async Task GetTargetActivateAndAttach() { var domains = session.GetVersionSpecificDomains(); driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("devToolsConsoleTest.html"); - var response = await domains.Target.GetTargets(); + var response = await domains.Target.GetTargets(new GetTargetsCommandSettings()); V107.Target.TargetInfo[] allTargets = response.TargetInfos; foreach (V107.Target.TargetInfo targetInfo in allTargets) { @@ -62,7 +60,7 @@ public async Task GetTargetAndSendMessageToTarget() ValidateMessage(e); sync.Set(); }; - var targetsResponse = await domains.Target.GetTargets(); + var targetsResponse = await domains.Target.GetTargets(new GetTargetsCommandSettings()); allTargets = targetsResponse.TargetInfos; ValidateTargetsInfos(allTargets); ValidateTarget(allTargets[0]);