Inheritance: Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the InternetExplorerDriver class.
 /// </summary>
 public InternetExplorerDriver()
 {
     handle = new SafeInternetExplorerDriverHandle();
     WebDriverResult result = NativeDriverLibrary.Instance.NewDriverInstance(ref handle);
     if (result != WebDriverResult.Success)
     {
         throw new WebDriverException(string.Format(CultureInfo.InvariantCulture, "Cannot create new browser instance: {0}", result.ToString()));
     }
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the InternetExplorerDriver class.
        /// </summary>
        public InternetExplorerDriver()
        {
            handle = new SafeInternetExplorerDriverHandle();
            WebDriverResult result = NativeDriverLibrary.Instance.NewDriverInstance(ref handle);

            if (result != WebDriverResult.Success)
            {
                throw new WebDriverException(string.Format(CultureInfo.InvariantCulture, "Cannot create new browser instance: {0}", result.ToString()));
            }
        }
コード例 #3
0
ファイル: Finder.cs プロジェクト: epall/selenium
        /// <summary>
        /// Initializes a new instance of the Finder class.
        /// </summary>
        /// <param name="driver">InternetExplorerDriver in use</param>
        /// <param name="parent">ElementHandle to for use with the Native methods</param>
        public Finder(InternetExplorerDriver driver, SafeInternetExplorerWebElementHandle parent)
        {
            this.driver = driver;
            if (parent != null)
            {
                this.parent = parent;
            }
            else
            {
                this.parent = new SafeInternetExplorerWebElementHandle();
            }

            handle = driver.GetUnderlayingHandle();
        }
コード例 #4
0
        /// <summary>
        /// If this current element is a form, or an element within a form, then this will be submitted to the remote server. If this causes the current page to change, then this method will block until the new page is loaded.
        /// </summary>
        /// <param name="attributeName">Attribute you wish to get details of.</param>
        /// <returns>The attribute's current value or null if the value is not set.</returns>
        public string GetAttribute(string attributeName)
        {
            SafeStringWrapperHandle          stringHandle = new SafeStringWrapperHandle();
            SafeInternetExplorerDriverHandle driverHandle = driver.GetUnderlayingHandle();
            WebDriverResult result = NativeDriverLibrary.Instance.GetElementAttribute(driverHandle, elementHandle, attributeName, ref stringHandle);

            ResultHandler.VerifyResultCode(result, string.Format(CultureInfo.InvariantCulture, "getting attribute '{0}' of the element", attributeName));
            string returnValue = null;

            using (StringWrapper wrapper = new StringWrapper(stringHandle))
            {
                returnValue = wrapper.Value;
            }

            return(returnValue);
        }
コード例 #5
0
ファイル: NativeDriverLibrary.cs プロジェクト: hugs/selenium
 /// <summary>
 /// Gets an attribute of the specified element.
 /// </summary>
 /// <param name="driverHandle">A handle to the instance of the <see cref="InternetExplorerDriver"/> class.</param>
 /// <param name="elementHandle">A handle to the instance of the <see cref="InternetExplorerWebElement"/> class.</param>
 /// <param name="attributeName">The name of the attribute.</param>
 /// <param name="attributeValueWrapperHandle">A pointer to a string containing the attribute value.</param>
 /// <returns>A <see cref="WebDriverResult"/> value indicating success or failure.</returns>
 internal WebDriverResult GetElementAttribute(SafeInternetExplorerDriverHandle driverHandle, SafeInternetExplorerWebElementHandle elementHandle, string attributeName, ref SafeStringWrapperHandle attributeValueWrapperHandle)
 {
     IntPtr functionPointer = NativeMethods.GetProcAddress(nativeLibraryHandle, GetElementAttributeFunctionName);
     GetElementAttributeFunction getAttributeFunction = Marshal.GetDelegateForFunctionPointer(functionPointer, typeof(GetElementAttributeFunction)) as GetElementAttributeFunction;
     WebDriverResult result = getAttributeFunction(driverHandle, elementHandle, attributeName, ref attributeValueWrapperHandle);
     return result;
 }
コード例 #6
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdeGetAttribute(SafeInternetExplorerDriverHandle driver, SafeInternetExplorerWebElementHandle wrapper, [MarshalAs(UnmanagedType.LPWStr)] string attributeName, ref SafeStringWrapperHandle result);
コード例 #7
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdCaptureScreenshotAsBase64(SafeInternetExplorerDriverHandle driver, out SafeStringWrapperHandle handle);
コード例 #8
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdSwitchToWindow(SafeInternetExplorerDriverHandle handle, string windowName);
コード例 #9
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdSwitchToActiveElement(SafeInternetExplorerDriverHandle driver, ref SafeInternetExplorerWebElementHandle result);
コード例 #10
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdRefresh(SafeInternetExplorerDriverHandle driver);
コード例 #11
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGoForward(SafeInternetExplorerDriverHandle driver);
コード例 #12
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGet(SafeInternetExplorerDriverHandle handle, string url);
コード例 #13
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdFindElementsByXPath(SafeInternetExplorerDriverHandle driver, SafeInternetExplorerWebElementHandle element, [MarshalAs(UnmanagedType.LPWStr)] string xpath, ref SafeWebElementCollectionHandle result);
コード例 #14
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdFindElementByTagName(SafeInternetExplorerDriverHandle driver, SafeInternetExplorerWebElementHandle element, [MarshalAs(UnmanagedType.LPWStr)] string linkText, ref SafeInternetExplorerWebElementHandle result);
コード例 #15
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdExecuteScript(SafeInternetExplorerDriverHandle driver, string script, SafeScriptArgsHandle scriptArgs, ref SafeScriptResultHandle scriptRes);
コード例 #16
0
ファイル: NativeDriverLibrary.cs プロジェクト: hugs/selenium
 /// <summary>
 /// Retrieves the value from the script result.
 /// </summary>
 /// <param name="scriptResultHandle">A handle to the result of the script.</param>
 /// <param name="driverHandle">A handle to the instance of the <see cref="InternetExplorerDriver"/> class.</param>
 /// <param name="scriptResultValue">A value representing the value of the returned object from the script.</param>
 /// <returns>A <see cref="WebDriverResult"/> value indicating success or failure.</returns>
 internal WebDriverResult GetElementScriptResult(SafeScriptResultHandle scriptResultHandle, SafeInternetExplorerDriverHandle driverHandle, out SafeInternetExplorerWebElementHandle scriptResultValue)
 {
     IntPtr functionPointer = NativeMethods.GetProcAddress(nativeLibraryHandle, GetElementScriptResultFunctionName);
     ElementReturningScriptResultFunction scriptResultFunction = Marshal.GetDelegateForFunctionPointer(functionPointer, typeof(ElementReturningScriptResultFunction)) as ElementReturningScriptResultFunction;
     WebDriverResult result = scriptResultFunction(scriptResultHandle, driverHandle, out scriptResultValue);
     return result;
 }
コード例 #17
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetScriptResultType(SafeInternetExplorerDriverHandle driver, SafeScriptResultHandle scriptResult, out int type);
コード例 #18
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetTitle(SafeInternetExplorerDriverHandle handle, ref SafeStringWrapperHandle result);
コード例 #19
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetAllWindowHandles(SafeInternetExplorerDriverHandle driver, ref SafeStringCollectionHandle handles);
コード例 #20
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdNewDriverInstance(ref SafeInternetExplorerDriverHandle handle);
コード例 #21
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetArrayItemFromScriptResult(SafeInternetExplorerDriverHandle driver, SafeScriptResultHandle scriptResult, int itemIndex, out SafeScriptResultHandle item);
コード例 #22
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdSetVisible(SafeInternetExplorerDriverHandle handle, int visible);
コード例 #23
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetArrayLengthScriptResult(SafeInternetExplorerDriverHandle driver, SafeScriptResultHandle scriptResult, out int arrayLength);
コード例 #24
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdSwitchToFrame(SafeInternetExplorerDriverHandle handle, string frameName);
コード例 #25
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetCookies(SafeInternetExplorerDriverHandle handle, ref SafeStringWrapperHandle cookies);
コード例 #26
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdWaitForLoadToComplete(SafeInternetExplorerDriverHandle driver);
コード例 #27
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetCurrentWindowHandle(SafeInternetExplorerDriverHandle driver, out SafeStringWrapperHandle handle);
コード例 #28
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdClose(SafeInternetExplorerDriverHandle driver);
コード例 #29
0
ファイル: Finder.cs プロジェクト: zerodiv/CTM-Windows-Agent
 /// <summary>
 /// Initializes a new instance of the Finder class.
 /// </summary>
 /// <param name="driver">InternetExplorerDriver in use</param>
 /// <param name="parent">ElementHandle to for use with the Native methods</param>
 public Finder(InternetExplorerDriver driver, SafeInternetExplorerWebElementHandle parent)
 {
     this.driver = driver;
     this.parent = parent;
     handle = driver.GetUnderlayingHandle();
 }
コード例 #30
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetElementScriptResult(SafeScriptResultHandle scriptResult, SafeInternetExplorerDriverHandle driver, out SafeInternetExplorerWebElementHandle value);
コード例 #31
0
ファイル: NativeDriverLibrary.cs プロジェクト: hugs/selenium
 /// <summary>
 /// Gets the identifying handle string of the current window.
 /// </summary>
 /// <param name="driverHandle">A handle to the instance of the <see cref="InternetExplorerDriver"/> class.</param>
 /// <param name="handleWrapperHandle">A pointer to a string containing the window .</param>
 /// <returns>A <see cref="WebDriverResult"/> value indicating success or failure.</returns>
 internal WebDriverResult GetCurrentWindowHandle(SafeInternetExplorerDriverHandle driverHandle, ref SafeStringWrapperHandle handleWrapperHandle)
 {
     IntPtr functionPointer = NativeMethods.GetProcAddress(nativeLibraryHandle, GetCurrentWindowHandleFunctionName);
     StringReturningDriverFunction getCurrentWindowHandleFunction = Marshal.GetDelegateForFunctionPointer(functionPointer, typeof(StringReturningDriverFunction)) as StringReturningDriverFunction;
     WebDriverResult result = getCurrentWindowHandleFunction(driverHandle, ref handleWrapperHandle);
     return result;
 }
コード例 #32
0
ファイル: Finder.cs プロジェクト: greghicks01/selenium
 /// <summary>
 /// Initializes a new instance of the Finder class.
 /// </summary>
 /// <param name="driver">InternetExplorerDriver in use</param>
 /// <param name="parent">ElementHandle to for use with the Native methods</param>
 public Finder(InternetExplorerDriver driver, SafeInternetExplorerWebElementHandle parent)
 {
     this.driver = driver;
     this.parent = parent;
     handle      = driver.GetUnderlayingHandle();
 }
コード例 #33
0
ファイル: NativeMethods.cs プロジェクト: epall/selenium
 internal static extern WebDriverResult wdGetPageSource(SafeInternetExplorerDriverHandle driver, ref SafeStringWrapperHandle wrapper);