Selenium API Common Methods

Source: Internet
Author: User

Driver.findelements ()
Locates a set of list elements

Driver.findelement ()
Positioning an Element

Driver.gettitle ()
Get page title

Driver.get ()
Open Address

Driver.getwindowhandle ()
Gets the handle of the current window

Driver.getwindowhandles ()
Gets a set of set handle sets

Driver.getcurrenturl ()
Gets the URL of the current page

Driver.getpagesource ()
Get page source code

Driver.close ()
Close the current browser window

Driver.quit ()
End driver Process

Driver.manage (). window (). Maximize ()
Window maximization

Driver.manage (). window (). Fullscreen ()
Window Full Screen

Driver.manage (). window (). GetPosition ()
Gets the coordinates of the browser window on the screen

Driver.manage (). window (). GetSize ()
Get the resolution of the browser window

Driver.manage (). window (). SetPosition ()
Set the coordinates of a window

Driver.manage (). window (). SetSize ()
Set the resolution of the window

Driver.manage (). Timeouts (). Implicitlywait ()
Setting the time-out for recognizing objects

Driver.manage (). Timeouts (). Pageloadtimeout ()
To set the time-out for page load

Driver.manage (). Timeouts (). Setscripttimeout ()
To set the time-out for an asynchronous script

Driver.manage (). Addcookie ()
Inject cookies

Driver.manage (). Deleteallcookies ()
Delete all Cookies

Driver.manage (). Deletecookie ()
Delete a cookie

Driver.manage (). deletecookienamed ();
Delete a cookie that has been named

Driver.manage (). getcookienamed ()
Get a cookie that has been named

Driver.manage (). GetCookies ()
Gets a set of set cookie sets

Driver.navigate (). Refresh ()
Refresh browser, similar to F5

Driver.navigate (). Back ()
Back up the browser

Driver.navigate (). Forward ()
Move the browser forward
Driver.navigate (). to ()
Make the browser jump to an address

Driver.switchto (). Activeelement ()
Gets the focus of the current element

Driver.switchto (). alert (). Accept ()
Confirm Alert pop-up window
Driver.switchto (). alert (). Dismiss ()
Cancel the alert pop-up window

Driver.switchto (). alert (). GetText ()
Get the text of the alert pop-up window

Driver.switchto (). alert (). SendKeys ()
Input operation on alert pop-up window
Driver.switchto (). Defaultcontent ()
Enter the default context

Driver.switchto (). FRAME ()
Enter into a frame

Driver.switchto (). Parentframe ()
Back operation in a multi-layered frame

Driver.switchto (). Window ()
Toggle Window Handle

Webelement.sendkeys ()
Input

Webelement.click ()
Click

Webelement.submit ()
Submit Form

Webelement.gettext ()
Get text

Webelement.getattribute ()
Get property value

Webelement.clear ()
Clear

Webelement.getcssvalue ()
Get CSS property values, such as color, font

Webelement.getlocation ()
Get coordinates

Webelement.getrect ()
Get location

Webelement.getsize ()
Get high and wide

Webelement.gettagname ()
Get the label signature

Webelement.isdisplayed ()
Whether the current element is visible

Webelement.isenabled ()
Whether the current element is disabled

Webelement.isselected ()
Whether the current element is selected

Selenium API Common Methods

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.