Inheritance: Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
 /// <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()));
     }
 }
        /// <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()));
            }
        }
Esempio n. 3
0
        /// <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();
        }
Esempio n. 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);
        }
Esempio n. 5
0
 /// <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;
 }
Esempio n. 6
0
 internal static extern WebDriverResult wdeGetAttribute(SafeInternetExplorerDriverHandle driver, SafeInternetExplorerWebElementHandle wrapper, [MarshalAs(UnmanagedType.LPWStr)] string attributeName, ref SafeStringWrapperHandle result);
Esempio n. 7
0
 internal static extern WebDriverResult wdCaptureScreenshotAsBase64(SafeInternetExplorerDriverHandle driver, out SafeStringWrapperHandle handle);
Esempio n. 8
0
 internal static extern WebDriverResult wdSwitchToWindow(SafeInternetExplorerDriverHandle handle, string windowName);
Esempio n. 9
0
 internal static extern WebDriverResult wdSwitchToActiveElement(SafeInternetExplorerDriverHandle driver, ref SafeInternetExplorerWebElementHandle result);
Esempio n. 10
0
 internal static extern WebDriverResult wdRefresh(SafeInternetExplorerDriverHandle driver);
Esempio n. 11
0
 internal static extern WebDriverResult wdGoForward(SafeInternetExplorerDriverHandle driver);
Esempio n. 12
0
 internal static extern WebDriverResult wdGet(SafeInternetExplorerDriverHandle handle, string url);
Esempio n. 13
0
 internal static extern WebDriverResult wdFindElementsByXPath(SafeInternetExplorerDriverHandle driver, SafeInternetExplorerWebElementHandle element, [MarshalAs(UnmanagedType.LPWStr)] string xpath, ref SafeWebElementCollectionHandle result);
Esempio n. 14
0
 internal static extern WebDriverResult wdFindElementByTagName(SafeInternetExplorerDriverHandle driver, SafeInternetExplorerWebElementHandle element, [MarshalAs(UnmanagedType.LPWStr)] string linkText, ref SafeInternetExplorerWebElementHandle result);
Esempio n. 15
0
 internal static extern WebDriverResult wdExecuteScript(SafeInternetExplorerDriverHandle driver, string script, SafeScriptArgsHandle scriptArgs, ref SafeScriptResultHandle scriptRes);
Esempio n. 16
0
 /// <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;
 }
Esempio n. 17
0
 internal static extern WebDriverResult wdGetScriptResultType(SafeInternetExplorerDriverHandle driver, SafeScriptResultHandle scriptResult, out int type);
Esempio n. 18
0
 internal static extern WebDriverResult wdGetTitle(SafeInternetExplorerDriverHandle handle, ref SafeStringWrapperHandle result);
Esempio n. 19
0
 internal static extern WebDriverResult wdGetAllWindowHandles(SafeInternetExplorerDriverHandle driver, ref SafeStringCollectionHandle handles);
Esempio n. 20
0
 internal static extern WebDriverResult wdNewDriverInstance(ref SafeInternetExplorerDriverHandle handle);
Esempio n. 21
0
 internal static extern WebDriverResult wdGetArrayItemFromScriptResult(SafeInternetExplorerDriverHandle driver, SafeScriptResultHandle scriptResult, int itemIndex, out SafeScriptResultHandle item);
Esempio n. 22
0
 internal static extern WebDriverResult wdSetVisible(SafeInternetExplorerDriverHandle handle, int visible);
Esempio n. 23
0
 internal static extern WebDriverResult wdGetArrayLengthScriptResult(SafeInternetExplorerDriverHandle driver, SafeScriptResultHandle scriptResult, out int arrayLength);
Esempio n. 24
0
 internal static extern WebDriverResult wdSwitchToFrame(SafeInternetExplorerDriverHandle handle, string frameName);
Esempio n. 25
0
 internal static extern WebDriverResult wdGetCookies(SafeInternetExplorerDriverHandle handle, ref SafeStringWrapperHandle cookies);
Esempio n. 26
0
 internal static extern WebDriverResult wdWaitForLoadToComplete(SafeInternetExplorerDriverHandle driver);
Esempio n. 27
0
 internal static extern WebDriverResult wdGetCurrentWindowHandle(SafeInternetExplorerDriverHandle driver, out SafeStringWrapperHandle handle);
Esempio n. 28
0
 internal static extern WebDriverResult wdClose(SafeInternetExplorerDriverHandle driver);
Esempio n. 29
0
 /// <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();
 }
Esempio n. 30
0
 internal static extern WebDriverResult wdGetElementScriptResult(SafeScriptResultHandle scriptResult, SafeInternetExplorerDriverHandle driver, out SafeInternetExplorerWebElementHandle value);
Esempio n. 31
0
 /// <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;
 }
Esempio n. 32
0
 /// <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();
 }
Esempio n. 33
0
 internal static extern WebDriverResult wdGetPageSource(SafeInternetExplorerDriverHandle driver, ref SafeStringWrapperHandle wrapper);