23 – Web Elements in Selenium

Selenium Class 23: Web Elements in Selenium

i) Web Elements
ii) Actions on Web Elements

i) Web Elements

Browser,
Page,
………
Edit Box,
Text Box,
Link,
Button,
Image, Image Link, Image Button
Text Area, Error Message, Popup Windows
Checkbox
Radio Button,
Drop down box,
List box,
Combo box,
Web Table / HTML Table,
Frame,
Etc…

ii) Actions on Web Elements

1) Browser

  • Launch Browser
  • Navigate to a URL
  • Close Browser
  • Close all Browsers
    ………………………
  • Navigate from one url to another
  • Navigate Back
  • Navigate Forward
  • Minimize the Browser window
  • Maximize the Browser Window
  • Browser Full Screen
  • Refresh the Browser
  • Capture the Browser URL
  • Select Home
    Etc…

2) Page

  • Get Page Title
  • Get Page Source
  • Get Page URL

3) Operations on Edit Box

  • Enter a Value
  • Check the existence of Edit Box
  • Check Enabled status
  • Edit the existing value
  • Clear the Value
  • Get / return the Value
    etc…

4) Operations on Link

i) Types of Links (as per UI design)
a) Text Link/s
b) Image Link/s

ii) Types of Links (as per Functionality)
a) Internal Link (Redirects to another location in the same page or redirects another page in the same application)
b) Outgoing Link (Redirects to another application)

Broken Link
Deleted link
…………………

  • Click
  • Check the existence of Link
  • Check Enabled Status of Link
  • Return Link Name
    Etc…
Selenium Training Video
Web Elements and Actions on Web Elements

5) Image


a) General Image

  • Check the existence of Image
  • Return Image Name
    etc…

b) Image Link

  • Click
  • Check the existence of Image Link
  • Check Enabled Status of Image Link
  • Return image Link Name
    etc…

c) Image Button

  • Click (Submits)
  • Check the existence of Image Button
  • Check Enabled Status of Image Button
  • Return Image Button Name Etc…

6) Operations on Checkbox

  • Select
  • Unselect
  • Check the existence of Checkbox
  • Check the enabled status of Checkbox
  • Check the Selected status of Checkbox
    etc…

7) Operations on Button

  • Click (submits)
  • Check the existence of Button
  • Check the enabled status of Button
  • Return Button Name
    Etc….

8) Operations on Radio Button

  • Select an Option
  • Check the existence of Radio Button
  • Check the enabled status of Radio Button
  • Check the selected status of Radio Button
    etc…

9) Operations on Drop down box

  • Select an Item
  • Check the existence of Drop down box
  • Check the enabled status of Drop down box
  • Return Items Count
    Etc…

10) Operations on List box

  • Select one or more Items
  • Check the existence of List box
  • Check the enabled status of List box
  • Return Items Count
    Etc…

11) Operations on Combo Box

  • Select an Item
  • Enter a New value
  • Check the existence of Combo Box
  • Check the enabled status of Combo Box
  • Return Items Count
    Etc…

12) Operations on Web table / HTML table

  • Check the existence of Web table
  • Return a Cell value
  • Return Rows Count
  • Return Columns Count

13) Operations on Frame

  • Frame means section of a web page and Frame may contain elements
  • If it is Manual Testing, we can directly operate elements in any frame.
  • In Automated Testing using Selenium, first we need to switch from Top window to a particular frame and operate elements…
    …………………………….
    Example:

Ex: In our Web page, total 3 frames,

Test Operations:

  • Launch the web Page with multiple frames
  • Operate an Element in 3rd Frame
  • Operate an Element in 2nd Frame
  • Operate an element in 1st Frame
    …………………………….
    Manual Testing:
  • Launch the web Page with multiple frames
  • Operate an Element in 3rd Frame
  • Operate an Element in 2nd Frame
  • Operate an element in 1st Frame

Automated Testing using Selenium:

  • Launch the web Page with multiple frames
  • Switch from Top Window to 3rd Frame
  • Operate an Element in the 3rd Frame
  • Switch from 3rd Frame to Top Window (Back to default)
  • Switch from Top Window to 2nd Frame
  • Operate an Element in the 2nd Frame
  • Switch from 2nd Frame to Top Window (Back to default)
  • Switch from Top Window to 1st Frame
  • Operate an Element in the 1st Frame
    …………………………………………………….