├── .gitattributes
├── .gitignore
├── AllDriversExample
├── AllDriversExample.csproj
├── App.config
├── App.xaml
├── App.xaml.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── packages.config
├── AsyncFirefoxDriver
├── AsyncFirefoxDriver.cs
├── AsyncFirefoxDriver.csproj
├── AsyncFirefoxDriver.nuspec
├── FirefoxDriverConfig.cs
├── FirefoxPreferences.cs
├── FirefoxProfilesWorker.cs
├── IAsyncFirefoxDriver.cs
├── IAsyncWebBrowserClient
│ ├── FirefoxDriverActionExecutor.cs
│ ├── FirefoxDriverAlert.cs
│ ├── FirefoxDriverCoordinates.cs
│ ├── FirefoxDriverElements.cs
│ ├── FirefoxDriverJavaScriptExecutor.cs
│ ├── FirefoxDriverKeyboard.cs
│ ├── FirefoxDriverMouse.cs
│ ├── FirefoxDriverNavigation.cs
│ ├── FirefoxDriverOptions.cs
│ ├── FirefoxDriverScreenshot.cs
│ ├── FirefoxDriverTargetLocator.cs
│ ├── FirefoxDriverTimeouts.cs
│ ├── FirefoxDriverTouchScreen.cs
│ ├── FirefoxDriverWindow.cs
│ ├── ResultValueConverter.cs
│ └── TimeoutType.cs
├── IniFileReader.cs
├── KeyValuePairVM.cs
├── MarionetteComands
│ ├── AcceptDialogCommand.cs
│ ├── ClearElementCommand.cs
│ ├── ClearImportedScriptsCommand.cs
│ ├── ClickElementCommand.cs
│ ├── CloseChromeWindowCommand.cs
│ ├── CloseCommand.cs
│ ├── DismissDialogCommand.cs
│ ├── ExecuteAsyncScriptCommand.cs
│ ├── ExecuteScriptCommand.cs
│ ├── FindElementCommand.cs
│ ├── FindElementsCommand.cs
│ ├── GetActiveElementCommand.cs
│ ├── GetActiveFrameCommand.cs
│ ├── GetChromeWindowHandleCommand.cs
│ ├── GetChromeWindowHandlesCommand.cs
│ ├── GetCommand.cs
│ ├── GetContextCommand.cs
│ ├── GetCurrentUrlCommand.cs
│ ├── GetElementAttributeCommand.cs
│ ├── GetElementPropertyCommand.cs
│ ├── GetElementRectCommand.cs
│ ├── GetElementTagNameCommand.cs
│ ├── GetElementTextCommand.cs
│ ├── GetElementValueOfCssPropertyCommand.cs
│ ├── GetPageSourceCommand.cs
│ ├── GetTextFromDialogCommand.cs
│ ├── GetTimeoutsCommand.cs
│ ├── GetTitleCommand.cs
│ ├── GetWindowHandleCommand.cs
│ ├── GetWindowHandlesCommand.cs
│ ├── GetWindowPositionCommand.cs
│ ├── GetWindowSizeCommand.cs
│ ├── GetWindowTypeCommand.cs
│ ├── GoBackCommand.cs
│ ├── GoForwardCommand.cs
│ ├── ImportScriptCommand.cs
│ ├── IsElementDisplayedCommand.cs
│ ├── IsElementEnabledCommand.cs
│ ├── IsElementSelectedCommand.cs
│ ├── MaximizeWindowCommand.cs
│ ├── NewSessionCommand.cs
│ ├── PerformActionsCommand.cs
│ ├── RefreshCommand.cs
│ ├── ReleaseActionsCommand.cs
│ ├── SendKeysToDialogCommand.cs
│ ├── SendKeysToElementCommand.cs
│ ├── SessionTearDownCommand.cs
│ ├── SetContextCommand.cs
│ ├── SetTimeoutsCommand.cs
│ ├── SetWindowPositionCommand.cs
│ ├── SetWindowSizeCommand.cs
│ ├── SwitchToFrameCommand.cs
│ ├── SwitchToParentFrameCommand.cs
│ ├── SwitchToWindowCommand.cs
│ └── TakeScreenshotCommand.cs
├── MarionetteDebuggerCommand.cs
├── MarionetteDebuggerCommandString.cs
├── Properties
│ └── AssemblyInfo.cs
├── js
│ └── mymarionetteserver.js
└── packages.config
├── AsyncFirefoxDriverExample
├── App.config
├── App.xaml
├── App.xaml.cs
├── AsyncFirefoxDriverExample.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── packages.config
├── AsyncWebDriver.sln
├── AsyncWebDriver
├── AsyncWebDriver.csproj
├── AsyncWebDriver.nuspec
├── AsyncWebDriver
│ ├── AsyncWebElement.cs
│ ├── RemoteTargetLocator.cs
│ ├── TaskExt.cs
│ ├── TaskRemoteTargetLocatorExtensions.cs
│ └── WebDriver.cs
├── By.cs
├── Exceptions
│ ├── ElementClickInterceptedException.cs
│ ├── ElementNotInteractableException.cs
│ ├── ElementNotSelectableException.cs
│ ├── ElementNotVisibleException.cs
│ ├── InvalidElementStateException.cs
│ ├── InvalidSelectorException.cs
│ ├── NoAlertPresentException.cs
│ ├── NoSuchElementException.cs
│ ├── NoSuchFrameException.cs
│ ├── NoSuchWindowException.cs
│ ├── NotFoundException.cs
│ ├── StaleElementReferenceException.cs
│ ├── UnhandledAlertException.cs
│ ├── WebDriverException.cs
│ └── WebDriverTimeoutException.cs
├── Extensions
│ ├── TaskCollectionsExtensions.cs
│ ├── TaskISearchContextExtensions.cs
│ ├── TaskIWebDriverExtensions.cs
│ ├── TaskIWebDriverTargetLocatorExtensions.cs
│ ├── TaskIWebElementExtensions.cs
│ ├── TaskStringExtensions.cs
│ └── TaskWebSizeWebPointExtensions.cs
├── IHasInputDevices.cs
├── IHasTouchScreen.cs
├── ISearchContext.cs
├── IWebDriver.cs
├── IWebDriverTargetLocator.cs
├── IWebElement.cs
├── Interactions
│ ├── ActionBuilder.cs
│ ├── Actions.cs
│ ├── BuiltAction.cs
│ ├── ButtonReleaseAction.cs
│ ├── ClickAction.cs
│ ├── ClickAndHoldAction.cs
│ ├── CompositeAction.cs
│ ├── ContextClickAction.cs
│ ├── DoubleClickAction.cs
│ ├── DoubleTapAction.cs
│ ├── FlickAction.cs
│ ├── KeyDownAction.cs
│ ├── KeyInputDevice.cs
│ ├── KeyUpAction.cs
│ ├── KeyboardAction.cs
│ ├── LongPressAction.cs
│ ├── MouseAction.cs
│ ├── MoveMouseAction.cs
│ ├── MoveToOffsetAction.cs
│ ├── PointerInputDevice.cs
│ ├── ScreenMoveAction.cs
│ ├── ScreenPressAction.cs
│ ├── ScreenReleaseAction.cs
│ ├── ScrollAction.cs
│ ├── SendKeysAction.cs
│ ├── SingleKeyAction.cs
│ ├── SingleTapAction.cs
│ ├── TouchAction.cs
│ ├── TouchActions.cs
│ └── WebDriverAction.cs
├── Internal
│ ├── IFindsByClassName.cs
│ ├── IFindsByCssSelector.cs
│ ├── IFindsById.cs
│ ├── IFindsByLinkText.cs
│ ├── IFindsByName.cs
│ ├── IFindsByPartialLinkText.cs
│ ├── IFindsByTagName.cs
│ ├── IFindsByXPath.cs
│ ├── IWebElementReference.cs
│ ├── IWrapsDriver.cs
│ ├── IWrapsElement.cs
│ └── ReturnedCookie.cs
└── SyncWrapper
│ ├── SyncAlert.cs
│ ├── SyncCookieJar.cs
│ ├── SyncCoordinates.cs
│ ├── SyncKeyboard.cs
│ ├── SyncLogs.cs
│ ├── SyncMouse.cs
│ ├── SyncNavigation.cs
│ ├── SyncOptions.cs
│ ├── SyncRemoteTargetLocator.cs
│ ├── SyncTimeouts.cs
│ ├── SyncWebDriver.cs
│ ├── SyncWebDriver1.cs
│ ├── SyncWebElement.cs
│ ├── SyncWebElement1.cs
│ └── SyncWindow.cs
├── LICENSE.txt
├── NOTICE
├── README.md
├── THIRD-PARTY-NOTICES
├── WebBrowserCommunication
├── AsyncProducerConsumerCollection.cs
├── DebuggerClient.cs
├── DebuggerClientMarionette.cs
├── DebuggerCommand.cs
├── DebuggerCommandException.cs
├── DebuggerConnection.cs
├── DebuggerConnectionMarionette.cs
├── IDebuggerClient.cs
├── IDebuggerConnection.cs
├── INetworkClient.cs
├── INetworkClientFactory.cs
├── LiveLogger.cs
├── MessageEventArgs.cs
├── NetworkClientFactory.cs
├── Properties
│ └── AssemblyInfo.cs
├── TcpNetworkClient.cs
├── WebBrowserCommunication.csproj
├── WebSocketNetworkClient.cs
├── WebSocketStream.cs
└── packages.config
└── ZuRequestListener
├── Properties
└── AssemblyInfo.cs
├── ZuRequestInfo.cs
├── ZuRequestListener.cs
├── ZuRequestListener.csproj
├── js
├── TracingListener.js
└── base64.js
└── packages.config
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
65 |
--------------------------------------------------------------------------------
/AllDriversExample/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/AllDriversExample/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/AllDriversExample/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace AllDriversExample
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/AllDriversExample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("AllDriversExaple")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("AllDriversExaple")]
15 | [assembly: AssemblyCopyright("Copyright © 2017")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/AllDriversExample/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AllDriversExample.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/AllDriversExample/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/AllDriversExample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/AsyncFirefoxDriver.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $id$
5 | $version$
6 | $title$
7 | $author$
8 | $author$
9 | https://github.com/ToCSharp/AsyncWebDriver/blob/master/LICENSE.txt
10 | https://github.com/ToCSharp/AsyncWebDriver
11 | false
12 | $description$
13 | Initial release.
14 | Copyright Oleg Zudov 2017
15 | AsyncFirefoxDriver Firefox WebDriver
16 |
17 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/IAsyncFirefoxDriver.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json.Linq;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using Zu.WebBrowser.Communication;
7 | using Zu.WebBrowser.Firefox;
8 |
9 | namespace Zu.Firefox
10 | {
11 | public interface IAsyncFirefoxDriver: IAsyncWebBrowserClientFirefox
12 | {
13 | IDebuggerClient ClientMarionette { get; set; }
14 |
15 | }
16 | }
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/IAsyncWebBrowserClient/FirefoxDriverCoordinates.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 | using Zu.WebBrowser.AsyncInteractions;
6 | using Zu.WebBrowser.BasicTypes;
7 |
8 | namespace Zu.Firefox
9 | {
10 | public class FirefoxDriverCoordinates: ICoordinates
11 | {
12 | private IAsyncFirefoxDriver asyncFirefoxDriver;
13 |
14 | public FirefoxDriverCoordinates(IAsyncFirefoxDriver asyncFirefoxDriver)
15 | {
16 | this.asyncFirefoxDriver = asyncFirefoxDriver;
17 | }
18 |
19 | public string AuxiliaryLocator => throw new System.NotImplementedException();
20 |
21 | public Task LocationInDom(CancellationToken cancellationToken = default(CancellationToken))
22 | {
23 | throw new System.NotImplementedException();
24 | }
25 |
26 | public Task LocationInViewport(CancellationToken cancellationToken = default(CancellationToken))
27 | {
28 | throw new System.NotImplementedException();
29 | }
30 |
31 | public Task LocationOnScreen(CancellationToken cancellationToken = default(CancellationToken))
32 | {
33 | throw new System.NotImplementedException();
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/IAsyncWebBrowserClient/FirefoxDriverKeyboard.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 | using System;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 | using Zu.WebBrowser.AsyncInteractions;
6 |
7 | namespace Zu.Firefox
8 | {
9 | internal class FirefoxDriverKeyboard : IKeyboard
10 | {
11 | private IAsyncFirefoxDriver asyncFirefoxDriver;
12 | public FirefoxDriverKeyboard(IAsyncFirefoxDriver asyncFirefoxDriver)
13 | {
14 | this.asyncFirefoxDriver = asyncFirefoxDriver;
15 | }
16 |
17 | public async Task PressKey(string keyToPress, CancellationToken cancellationToken = default (CancellationToken))
18 | {
19 | await asyncFirefoxDriver.CheckConnected(cancellationToken).ConfigureAwait(false);
20 | var el = await asyncFirefoxDriver.TargetLocator.SwitchToActiveElement(cancellationToken).ConfigureAwait(false);
21 | await asyncFirefoxDriver.Elements.SendKeysToElement(el, keyToPress).ConfigureAwait(false);
22 | }
23 |
24 | public async Task ReleaseKey(string keyToRelease, CancellationToken cancellationToken = default (CancellationToken))
25 | {
26 | await asyncFirefoxDriver.CheckConnected(cancellationToken).ConfigureAwait(false);
27 | throw new NotImplementedException();
28 | }
29 |
30 | public async Task SendKeys(string keySequence, CancellationToken cancellationToken = default (CancellationToken))
31 | {
32 | await asyncFirefoxDriver.CheckConnected(cancellationToken).ConfigureAwait(false);
33 | var el = await asyncFirefoxDriver.TargetLocator.SwitchToActiveElement(cancellationToken).ConfigureAwait(false);
34 | await asyncFirefoxDriver.Elements.SendKeysToElement(el, keySequence).ConfigureAwait(false);
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/IAsyncWebBrowserClient/FirefoxDriverOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Zu.WebBrowser.BrowserOptions;
4 |
5 | namespace Zu.Firefox
6 | {
7 | public class FirefoxDriverOptions: IOptions
8 | {
9 | private IAsyncFirefoxDriver asyncFirefoxDriver;
10 | private FirefoxDriverWindow window;
11 | private FirefoxDriverTimeouts timeouts;
12 |
13 | public FirefoxDriverOptions(IAsyncFirefoxDriver asyncFirefoxDriver)
14 | {
15 | this.asyncFirefoxDriver = asyncFirefoxDriver;
16 | }
17 |
18 | public ICookieJar Cookies => throw new System.NotImplementedException();
19 |
20 | public IWindow Window { get { if (window == null) window = new FirefoxDriverWindow(asyncFirefoxDriver); return window; } }
21 |
22 | public ILogs Logs => throw new System.NotImplementedException();
23 |
24 | public ITimeouts Timeouts { get { if (timeouts == null) timeouts = new FirefoxDriverTimeouts(asyncFirefoxDriver); return timeouts; } }
25 |
26 | public bool HasLocationContext => throw new System.NotImplementedException();
27 |
28 | public ILocationContext LocationContext => throw new System.NotImplementedException();
29 |
30 | public bool HasApplicationCache => throw new System.NotImplementedException();
31 |
32 | public IApplicationCache ApplicationCache => throw new System.NotImplementedException();
33 |
34 | public ILocalStorage LocalStorage => throw new System.NotImplementedException();
35 |
36 | public ISessionStorage SessionStorage => throw new System.NotImplementedException();
37 | }
38 | }
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/IAsyncWebBrowserClient/FirefoxDriverScreenshot.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 | using MyCommunicationLib.Communication.MarionetteComands;
3 | using System;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using Zu.WebBrowser.AsyncInteractions;
7 | using Zu.WebBrowser.BasicTypes;
8 |
9 | namespace Zu.Firefox
10 | {
11 | internal class FirefoxDriverScreenshot : ITakesScreenshot
12 | {
13 | private IAsyncFirefoxDriver asyncFirefoxDriver;
14 | public FirefoxDriverScreenshot(IAsyncFirefoxDriver asyncFirefoxDriver)
15 | {
16 | this.asyncFirefoxDriver = asyncFirefoxDriver;
17 | }
18 |
19 | //TODO
20 | public Task GetScreenshot(CancellationToken cancellationToken = default (CancellationToken))
21 | {
22 | return TakeScreenshot(null, null, null, null, cancellationToken);
23 | }
24 |
25 | public async Task TakeScreenshot(string elementId, string highlights, string full, string hash, CancellationToken cancellationToken = new CancellationToken())
26 | {
27 | await asyncFirefoxDriver.CheckConnected(cancellationToken).ConfigureAwait(false);
28 | if (asyncFirefoxDriver.ClientMarionette == null)
29 | throw new Exception("error: no clientMarionette");
30 | var comm1 = new TakeScreenshotCommand(elementId, highlights, full, hash);
31 | await asyncFirefoxDriver.ClientMarionette.SendRequestAsync(comm1, cancellationToken).ConfigureAwait(false);
32 | if (comm1.Error != null)
33 | throw new WebBrowserException(comm1.Error);
34 | return new Screenshot((string)comm1.Result?["value"]);
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/IAsyncWebBrowserClient/TimeoutType.cs:
--------------------------------------------------------------------------------
1 | namespace Zu.Firefox
2 | {
3 | public enum TimeoutType
4 | {
5 | @implicit = 0,
6 | script = 1,
7 | page_load = 2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/KeyValuePairVM.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using System.Collections.Generic;
4 |
5 | namespace Zu.Firefox
6 | {
7 | public class KeyValuePairVM
8 | {
9 | private KeyValuePair v;
10 |
11 | public KeyValuePairVM(KeyValuePair v)
12 | {
13 | this.v = v;
14 | }
15 |
16 | public string Name => v.Key;
17 | public string Val => v.Value;
18 |
19 | public override string ToString()
20 | {
21 | return $"{v.Key} ({v.Value})";
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/AcceptDialogCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 |
6 | namespace MyCommunicationLib.Communication.MarionetteComands
7 | {
8 | public class AcceptDialogCommand : MarionetteDebuggerCommand
9 | {
10 | public AcceptDialogCommand(int id = 0, string commandName = "acceptDialog") : base(id, commandName)
11 | {
12 | }
13 | public override void ProcessResponse(JToken response)
14 | {
15 | base.ProcessResponse(response);
16 | }
17 |
18 | public override string ToString()
19 | {
20 | return JsonConvert.SerializeObject(
21 | new object[]
22 | {
23 | 0,
24 | Id,
25 | CommandName,
26 |
27 | });
28 |
29 | }
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/ClearElementCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class ClearElementCommand : MarionetteDebuggerCommand
14 | {
15 | public ClearElementCommand(string elementId, int id = 0, string commandName = "clearElement") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | }
19 |
20 | public string ElementId { get; set; }
21 |
22 | public override void ProcessResponse(JToken response)
23 | {
24 | base.ProcessResponse(response);
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return JsonConvert.SerializeObject(
30 | new object[]
31 | {
32 | 0,
33 | Id,
34 | CommandName,
35 | new {
36 | id = ElementId,
37 | }
38 |
39 | });
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/ClearImportedScriptsCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class ClearImportedScriptsCommand : MarionetteDebuggerCommand
14 | {
15 | /**
16 | * Clear all scripts that are imported into the JS evaluation runtime.
17 | *
18 | * Scripts can be imported using the {@code importScript} command.
19 | */
20 | public ClearImportedScriptsCommand(int id = 0, string commandName = "clearImportedScripts") : base(id, commandName)
21 | {
22 | }
23 |
24 | public override void ProcessResponse(JToken response)
25 | {
26 | base.ProcessResponse(response);
27 | }
28 |
29 | public override string ToString()
30 | {
31 | return JsonConvert.SerializeObject(
32 | new object[]
33 | {
34 | 0,
35 | Id,
36 | CommandName,
37 |
38 | });
39 |
40 | }
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/ClickElementCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class ClickElementCommand : MarionetteDebuggerCommand
14 | {
15 | public ClickElementCommand(string elementId, int id = 0, string commandName = "clickElement") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | }
19 |
20 | public string ElementId { get; set; }
21 |
22 | public override void ProcessResponse(JToken response)
23 | {
24 | base.ProcessResponse(response);
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return JsonConvert.SerializeObject(
30 | new object[]
31 | {
32 | 0,
33 | Id,
34 | CommandName,
35 | new {
36 | id = ElementId,
37 | }
38 |
39 | });
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/CloseChromeWindowCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class CloseChromeWindowCommand : MarionetteDebuggerCommand
14 | {
15 | public CloseChromeWindowCommand(int id = 0, string commandName = "closeChromeWindow") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 |
33 | });
34 |
35 | }
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/CloseCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class CloseCommand : MarionetteDebuggerCommand
14 | {
15 | public CloseCommand(int id = 0, string commandName = "close") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 |
33 | });
34 |
35 | }
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/DismissDialogCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class DismissDialogCommand : MarionetteDebuggerCommand
14 | {
15 | public DismissDialogCommand(int id = 0, string commandName = "dismissDialog") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 |
33 | });
34 |
35 | }
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/ExecuteAsyncScriptCommand.cs:
--------------------------------------------------------------------------------
1 |
2 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3 |
4 | using Newtonsoft.Json;
5 | using Newtonsoft.Json.Linq;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 |
12 | namespace MyCommunicationLib.Communication.MarionetteComands
13 | {
14 | public class ExecuteAsyncScriptCommand : MarionetteDebuggerCommand
15 | {
16 | public ExecuteAsyncScriptCommand(string code, int id = 0) : base(id, "executeAsyncScript")
17 | {
18 | Code = code;
19 | }
20 |
21 | public string Code { get; set; }
22 |
23 |
24 | public object[] Args { get; set; } = new object[0];
25 | public bool newSandbox { get; set; } = false;
26 | public string sandbox { get; set; }
27 | public object scriptTimeout { get; set; }
28 | public bool specialPowers { get; set; } = false;
29 | public string filename { get; set; } = null;
30 |
31 | public override void ProcessResponse(JToken response)
32 | {
33 | base.ProcessResponse(response);
34 | }
35 |
36 | public override string ToString()
37 | {
38 | if (sandbox != null)
39 | {
40 | return JsonConvert.SerializeObject(
41 | new object[]
42 | {
43 | 0,
44 | Id,
45 | "executeAsyncScript",
46 | new {
47 | args = Args,
48 | sandbox = sandbox,
49 | newSandbox = newSandbox,
50 | script = Code,
51 | scriptTimeout = scriptTimeout,
52 | specialPowers = specialPowers,
53 | filename = filename
54 | }
55 |
56 | });
57 |
58 | }
59 | return JsonConvert.SerializeObject(
60 | new object[]
61 | {
62 | 0,
63 | Id,
64 | "executeAsyncScript",
65 | new {
66 | args = Args,
67 | newSandbox = newSandbox,
68 | script = Code,
69 | scriptTimeout = scriptTimeout,
70 | specialPowers = specialPowers,
71 | filename = filename
72 | }
73 |
74 | });
75 |
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/ExecuteScriptCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class ExecuteScriptCommand : MarionetteDebuggerCommand
14 | {
15 | public ExecuteScriptCommand(string code, int id = 0) : base(id, "executeScript")
16 | {
17 | Code = code;
18 | }
19 |
20 | public string Code { get; set; }
21 |
22 |
23 | public object[] Args { get; set; } = new object[0];
24 | public bool newSandbox { get; set; } = false;
25 | public string sandbox { get; set; }
26 | public object scriptTimeout { get; set; }
27 | public bool specialPowers { get; set; } = false;
28 | public string filename { get; set; } = null;
29 |
30 | public override void ProcessResponse(JToken response)
31 | {
32 | base.ProcessResponse(response);
33 | }
34 |
35 | public override string ToString()
36 | {
37 | if (sandbox != null)
38 | {
39 | return JsonConvert.SerializeObject(
40 | new object[]
41 | {
42 | 0,
43 | Id,
44 | "executeScript",
45 | new {
46 | args = Args,
47 | sandbox = sandbox,
48 | newSandbox = newSandbox,
49 | script = Code,
50 | scriptTimeout = scriptTimeout,
51 | specialPowers = specialPowers,
52 | filename = filename
53 | }
54 |
55 | });
56 |
57 | }
58 | return JsonConvert.SerializeObject(
59 | new object[]
60 | {
61 | 0,
62 | Id,
63 | "executeScript",
64 | new {
65 | args = Args,
66 | newSandbox = newSandbox,
67 | script = Code,
68 | scriptTimeout = scriptTimeout,
69 | specialPowers = specialPowers,
70 | filename = filename
71 | }
72 |
73 | });
74 |
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/FindElementCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class FindElementCommand : MarionetteDebuggerCommand
14 | {
15 | public FindElementCommand(string strategy, string expr, string startNode = null, int id = 0, string commandName = "findElement") : base(id, commandName)
16 | {
17 | Strategy = strategy;
18 | Expr = expr;
19 | StartNode = startNode;
20 | }
21 |
22 | public string Strategy { get; set; }
23 | public string Expr { get; set; }
24 | public string StartNode { get; set; }
25 |
26 | public override void ProcessResponse(JToken response)
27 | {
28 | base.ProcessResponse(response);
29 | }
30 |
31 | public override string ToString()
32 | {
33 | if (StartNode == null)
34 | {
35 | return JsonConvert.SerializeObject(
36 | new object[]
37 | {
38 | 0,
39 | Id,
40 | "findElement",
41 | new {
42 | @using = Strategy,
43 | value = Expr,
44 | }
45 |
46 | });
47 | }
48 | else
49 | {
50 | return JsonConvert.SerializeObject(
51 | new object[]
52 | {
53 | 0,
54 | Id,
55 | "findElement",
56 | new {
57 | @using = Strategy,
58 | value = Expr,
59 | element = StartNode
60 | }
61 |
62 | });
63 | }
64 |
65 | //if (StartNode == null) return $"[0, {Id}, \"{CommandName}\", {{\"using\" : \"{Strategy}\", \"value\": \"{Expr?.Replace("\"", "\\\"")}\"}} ]";
66 | //return $"[0, {Id}, \"{CommandName}\", {{\"using\" : \"{Strategy}\", \"value\": \"{Expr?.Replace("\"", "\\\"")}\", \"element\": \"{StartNode.Replace("\"", "\\\"")}\"}} ]";
67 |
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/FindElementsCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class FindElementsCommand : MarionetteDebuggerCommand
14 | {
15 | public FindElementsCommand(string strategy, string expr, string startNode = null, int id = 0, string commandName = "findElements") : base(id, commandName)
16 | {
17 | Strategy = strategy;
18 | Expr = expr;
19 | StartNode = startNode;
20 | }
21 |
22 | public string Strategy { get; set; }
23 | public string Expr { get; set; }
24 | public string StartNode { get; set; }
25 |
26 | public override void ProcessResponse(JToken response)
27 | {
28 | base.ProcessResponse(response);
29 | }
30 |
31 | public override string ToString()
32 | {
33 | if (StartNode == null)
34 | {
35 | return JsonConvert.SerializeObject(
36 | new object[]
37 | {
38 | 0,
39 | Id,
40 | "findElements",
41 | new {
42 | @using = Strategy,
43 | value = Expr,
44 | }
45 |
46 | });
47 | }
48 | else
49 | {
50 | return JsonConvert.SerializeObject(
51 | new object[]
52 | {
53 | 0,
54 | Id,
55 | "findElements",
56 | new {
57 | @using = Strategy,
58 | value = Expr,
59 | element = StartNode
60 | }
61 |
62 | });
63 | }
64 | //if (StartNode == null) return $"[0, {Id}, \"{CommandName}\", {{\"using\" : \"{Strategy}\", \"value\": \"{Expr?.Replace("\"", "\\\"")}\"}} ]";
65 | //return $"[0, {Id}, \"{CommandName}\", {{\"using\" : \"{Strategy}\", \"value\": \"{Expr?.Replace("\"", "\\\"")}\", \"element\": \"{StartNode.Replace("\"", "\\\"")}\"}} ]";
66 |
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetActiveElementCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetActiveElementCommand : MarionetteDebuggerCommand
14 | {
15 | public GetActiveElementCommand(int id = 0, string commandName = "getActiveElement") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetActiveFrameCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetActiveFrameCommand : MarionetteDebuggerCommand
14 | {
15 | public GetActiveFrameCommand(int id = 0, string commandName = "getActiveFrame") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetChromeWindowHandleCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetChromeWindowHandleCommand : MarionetteDebuggerCommand
14 | {
15 | public GetChromeWindowHandleCommand(int id = 0, string commandName = "getChromeWindowHandle") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetChromeWindowHandlesCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetChromeWindowHandlesCommand : MarionetteDebuggerCommand
14 | {
15 | public GetChromeWindowHandlesCommand(int id = 0, string commandName = "getChromeWindowHandles") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetCommand : MarionetteDebuggerCommand
14 | {
15 | ///
16 | /// Navigate to given URL.
17 | ///
18 | ///
19 | public GetCommand(string url, int id = 0, string commandName = "get") : base(id, commandName)
20 | {
21 | Url = url;
22 | }
23 | public string Url { get; set; }
24 | public override void ProcessResponse(JToken response)
25 | {
26 | base.ProcessResponse(response);
27 | }
28 |
29 | public override string ToString()
30 | {
31 | return JsonConvert.SerializeObject(
32 | new object[]
33 | {
34 | 0,
35 | Id,
36 | CommandName,
37 | new {
38 | url = Url
39 | }
40 |
41 | });
42 |
43 | }
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetContextCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetContextCommand : MarionetteDebuggerCommand
14 | {
15 | public GetContextCommand(int id = 0, string commandName = "getContext") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetCurrentUrlCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetCurrentUrlCommand : MarionetteDebuggerCommand
14 | {
15 | public GetCurrentUrlCommand(int id = 0, string commandName = "getCurrentUrl") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetElementAttributeCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetElementAttributeCommand : MarionetteDebuggerCommand
14 | {
15 | public GetElementAttributeCommand(string elementId, string attrName, int id = 0, string commandName = "getElementAttribute") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | AttrName = attrName;
19 | }
20 |
21 | public string ElementId { get; set; }
22 | public string AttrName { get; set; }
23 |
24 | public override void ProcessResponse(JToken response)
25 | {
26 | base.ProcessResponse(response);
27 | }
28 |
29 | public override string ToString()
30 | {
31 | return JsonConvert.SerializeObject(
32 | new object[]
33 | {
34 | 0,
35 | Id,
36 | CommandName,
37 | new {
38 | id = ElementId,
39 | name = AttrName
40 | }
41 |
42 | });
43 | //return $"[0, {Id}, \"{CommandName}\", {{\"id\": \"{ElementId}\", \"name\": \"{AttrName}\"}} ]";
44 |
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetElementPropertyCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetElementPropertyCommand : MarionetteDebuggerCommand
14 | {
15 | public GetElementPropertyCommand(string elementId, string propName, int id = 0, string commandName = "getElementProperty") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | PropertyName = propName;
19 | }
20 |
21 | public string ElementId { get; set; }
22 | public string PropertyName { get; set; }
23 |
24 | public override void ProcessResponse(JToken response)
25 | {
26 | base.ProcessResponse(response);
27 | }
28 |
29 | public override string ToString()
30 | {
31 | return JsonConvert.SerializeObject(
32 | new object[]
33 | {
34 | 0,
35 | Id,
36 | CommandName,
37 | new {
38 | id = ElementId,
39 | name = PropertyName
40 | }
41 |
42 | });
43 | //return $"[0, {Id}, \"{CommandName}\", {{\"id\": \"{ElementId}\", \"name\": \"{PropertyName}\"}} ]";
44 |
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetElementRectCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetElementRectCommand : MarionetteDebuggerCommand
14 | {
15 | public GetElementRectCommand(string elementId, int id = 0, string commandName = "getElementRect") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | }
19 |
20 | public string ElementId { get; set; }
21 |
22 | public override void ProcessResponse(JToken response)
23 | {
24 | base.ProcessResponse(response);
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return JsonConvert.SerializeObject(
30 | new object[]
31 | {
32 | 0,
33 | Id,
34 | CommandName,
35 | new {
36 | id = ElementId,
37 | }
38 |
39 | });
40 | //return $"[0, {Id}, \"{CommandName}\", {{\"id\": \"{ElementId}\"}} ]";
41 |
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetElementTagNameCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetElementTagNameCommand : MarionetteDebuggerCommand
14 | {
15 | public GetElementTagNameCommand(string elementId, int id = 0, string commandName = "getElementTagName") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | }
19 | public string ElementId { get; set; }
20 |
21 | public override void ProcessResponse(JToken response)
22 | {
23 | base.ProcessResponse(response);
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return JsonConvert.SerializeObject(
29 | new object[]
30 | {
31 | 0,
32 | Id,
33 | CommandName,
34 | new {
35 | id = ElementId,
36 | }
37 |
38 | });
39 |
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetElementTextCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetElementTextCommand : MarionetteDebuggerCommand
14 | {
15 | public GetElementTextCommand(string elementId, int id = 0, string commandName = "getElementText") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | }
19 |
20 | public string ElementId { get; set; }
21 |
22 | public override void ProcessResponse(JToken response)
23 | {
24 | base.ProcessResponse(response);
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return JsonConvert.SerializeObject(
30 | new object[]
31 | {
32 | 0,
33 | Id,
34 | CommandName,
35 | new {
36 | id = ElementId,
37 | }
38 |
39 | });
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetElementValueOfCssPropertyCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetElementValueOfCssPropertyCommand : MarionetteDebuggerCommand
14 | {
15 | public GetElementValueOfCssPropertyCommand(string elementId, string propName, int id = 0, string commandName = "getElementValueOfCssProperty") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | PropertyName = propName;
19 | }
20 | public string ElementId { get; set; }
21 | public string PropertyName { get; set; }
22 |
23 | public override void ProcessResponse(JToken response)
24 | {
25 | base.ProcessResponse(response);
26 | }
27 |
28 | public override string ToString()
29 | {
30 | return JsonConvert.SerializeObject(
31 | new object[]
32 | {
33 | 0,
34 | Id,
35 | CommandName,
36 | new {
37 | id = ElementId,
38 | name = PropertyName
39 | }
40 |
41 | });
42 |
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetPageSourceCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetPageSourceCommand : MarionetteDebuggerCommand
14 | {
15 | public GetPageSourceCommand(int id = 0, string commandName = "getPageSource") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetTextFromDialogCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetTextFromDialogCommand : MarionetteDebuggerCommand
14 | {
15 | public GetTextFromDialogCommand(int id = 0, string commandName = "getTextFromDialog") : base(id, commandName)
16 | {
17 | }
18 | public override void ProcessResponse(JToken response)
19 | {
20 | base.ProcessResponse(response);
21 | }
22 |
23 | public override string ToString()
24 | {
25 | return JsonConvert.SerializeObject(
26 | new object[]
27 | {
28 | 0,
29 | Id,
30 | CommandName,
31 |
32 | });
33 |
34 | }
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetTimeoutsCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetTimeoutsCommand : MarionetteDebuggerCommand
14 | {
15 | public GetTimeoutsCommand(int id = 0, string commandName = "getTimeouts") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetTitleCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetTitleCommand : MarionetteDebuggerCommand
14 | {
15 | public GetTitleCommand(int id = 0, string commandName = "getTitle") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetWindowHandleCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetWindowHandleCommand : MarionetteDebuggerCommand
14 | {
15 | public GetWindowHandleCommand(int id = 0, string commandName = "getWindowHandle") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetWindowHandlesCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetWindowHandlesCommand : MarionetteDebuggerCommand
14 | {
15 | public GetWindowHandlesCommand(int id = 0, string commandName = "getWindowHandles") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetWindowPositionCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetWindowPositionCommand : MarionetteDebuggerCommand
14 | {
15 | public GetWindowPositionCommand(int id = 0, string commandName = "getWindowPosition") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetWindowSizeCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetWindowSizeCommand : MarionetteDebuggerCommand
14 | {
15 | public GetWindowSizeCommand(int id = 0, string commandName = "getWindowSize") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GetWindowTypeCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GetWindowTypeCommand : MarionetteDebuggerCommand
14 | {
15 | public GetWindowTypeCommand(int id = 0, string commandName = "getWindowType") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 | });
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GoBackCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GoBackCommand : MarionetteDebuggerCommand
14 | {
15 | public GoBackCommand(int id = 0, string commandName = "goBack") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | CommandName,
32 |
33 | });
34 |
35 | }
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/GoForwardCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class GoForwardCommand : MarionetteDebuggerCommand
14 | {
15 | public GoForwardCommand(int id = 0, string commandName = "goForward") : base(id, commandName)
16 | {
17 | }
18 | public override void ProcessResponse(JToken response)
19 | {
20 | base.ProcessResponse(response);
21 | }
22 |
23 | public override string ToString()
24 | {
25 | return JsonConvert.SerializeObject(
26 | new object[]
27 | {
28 | 0,
29 | Id,
30 | CommandName,
31 |
32 | });
33 |
34 | }
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/ImportScriptCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class ImportScriptCommand : MarionetteDebuggerCommand
14 | {
15 | /**
16 | * Import script to the JS evaluation runtime.
17 | *
18 | * Imported scripts are exposed in the contexts of all subsequent
19 | * calls to {@code executeScript}, {@code executeAsyncScript}, and
20 | * {@code executeJSScript} by prepending them to the evaluated script.
21 | *
22 | * Scripts can be cleared with the {@code clearImportedScripts} command.
23 | *
24 | * @param {string} script
25 | * Script to include. If the script is byte-by-byte equal to an
26 | * existing imported script, it is not imported.
27 | */
28 | public ImportScriptCommand(string script, int id = 0, string commandName = "importScript") : base(id, commandName)
29 | {
30 | Script = script;
31 | }
32 |
33 | public string Script { get; set; }
34 |
35 | public override void ProcessResponse(JToken response)
36 | {
37 | base.ProcessResponse(response);
38 | }
39 |
40 | public override string ToString()
41 | {
42 | return JsonConvert.SerializeObject(
43 | new object[]
44 | {
45 | 0,
46 | Id,
47 | CommandName,
48 | new {
49 | script = Script,
50 | }
51 |
52 | });
53 |
54 | //return $"[0, {Id}, \"{CommandName}\", {{\"script\": \"{Script}\"}} ]";
55 |
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/IsElementDisplayedCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class IsElementDisplayedCommand : MarionetteDebuggerCommand
14 | {
15 | public IsElementDisplayedCommand(string elementId, int id = 0, string commandName = "isElementDisplayed") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | }
19 |
20 | public string ElementId { get; set; }
21 |
22 | public override void ProcessResponse(JToken response)
23 | {
24 | base.ProcessResponse(response);
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return JsonConvert.SerializeObject(
30 | new object[]
31 | {
32 | 0,
33 | Id,
34 | CommandName,
35 | new {
36 | id = ElementId,
37 | }
38 |
39 | });
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/IsElementEnabledCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class IsElementEnabledCommand : MarionetteDebuggerCommand
14 | {
15 | public IsElementEnabledCommand(string elementId, int id = 0, string commandName = "isElementEnabled") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | }
19 |
20 | public string ElementId { get; set; }
21 |
22 | public override void ProcessResponse(JToken response)
23 | {
24 | base.ProcessResponse(response);
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return JsonConvert.SerializeObject(
30 | new object[]
31 | {
32 | 0,
33 | Id,
34 | CommandName,
35 | new {
36 | id = ElementId,
37 | }
38 |
39 | });
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/IsElementSelectedCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class IsElementSelectedCommand : MarionetteDebuggerCommand
14 | {
15 | public IsElementSelectedCommand(string elementId, int id = 0, string commandName = "isElementSelected") : base(id, commandName)
16 | {
17 | ElementId = elementId;
18 | }
19 |
20 | public string ElementId { get; set; }
21 |
22 | public override void ProcessResponse(JToken response)
23 | {
24 | base.ProcessResponse(response);
25 | }
26 |
27 | public override string ToString()
28 | {
29 | return JsonConvert.SerializeObject(
30 | new object[]
31 | {
32 | 0,
33 | Id,
34 | CommandName,
35 | new {
36 | id = ElementId,
37 | }
38 |
39 | });
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/MaximizeWindowCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class MaximizeWindowCommand : MarionetteDebuggerCommand
14 | {
15 | public MaximizeWindowCommand(int id = 0, string commandName = "maximizeWindow") : base(id, commandName)
16 | {
17 | }
18 | public override void ProcessResponse(JToken response)
19 | {
20 | base.ProcessResponse(response);
21 | }
22 |
23 | public override string ToString()
24 | {
25 | return JsonConvert.SerializeObject(
26 | new object[]
27 | {
28 | 0,
29 | Id,
30 | CommandName,
31 |
32 | });
33 |
34 | }
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/NewSessionCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class NewSessionCommand : MarionetteDebuggerCommand
14 | {
15 | public NewSessionCommand(int id = 0, string commandName = "") : base(id, commandName)
16 | {
17 | }
18 |
19 | public override void ProcessResponse(JToken response)
20 | {
21 | base.ProcessResponse(response);
22 | }
23 |
24 | public override string ToString()
25 | {
26 | return JsonConvert.SerializeObject(
27 | new object[]
28 | {
29 | 0,
30 | Id,
31 | "newSession",
32 | new {
33 | capabilities = new
34 | {
35 | desiredCapabilities = new
36 | {
37 | browserName = "firefox",
38 | marionette = true,
39 | platform = "ANY",
40 | version = ""
41 | },
42 | requiredCapabilities = new
43 | {
44 |
45 | }
46 | },
47 | //sessionId = null
48 | }
49 |
50 | });
51 |
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/AsyncFirefoxDriver/MarionetteComands/PerformActionsCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Oleg Zudov. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Linq;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace MyCommunicationLib.Communication.MarionetteComands
12 | {
13 | public class PerformActionsCommand : MarionetteDebuggerCommand
14 | {
15 | public PerformActionsCommand(List