How Selenium works(elements status/3:Firefox)

2020-07-29

Overview

Test page

Firefox

77.0.1
Version 78.01(64bit)

Button

Click

First, enter the id of the element in the locator field and press the “id" button. Next, press the “click" button.
If successful, the executed code of Python is displayed.

Normal

Click event occurred
Click event occurred

Inactive(disabled)

No response
No response

Inactive(pointer-events:none)

Exception occurred
Exception occurred
ElementClickInterceptedExceptionMessage: Element <input id="submit3" class="btn-submit" type="submit"> is not clickable at point (831,446) because it does not have pointer events enabled, and element <div> would receive the click instead
<traceback object at 0x000001CC524FF348>

Read-only(readonly)

Click event occurred
Click event occurred

Hidden(display:none)

Exception occurred
Exception occurred
ElementNotInteractableExceptionMessage: Element <input id="submit5" class="btn-submit" type="submit"> could not be scrolled into view
<traceback object at 0x000001CC50E99E08>

Hidden(visibility:hidden)

Exception occurred
Exception occurred

Get Attribute

Normal

get attribute
displayed:True / enabled:True / readonly:None

Inactive(disabled)

get attribute
displayed:True / enabled:False / readonly:None

Inactive(pointer-events:none)

get attribute
displayed:True / enabled:True / readonly:None

Read-only(readonly)

get attribute
displayed:True / enabled:True / readonly:true

Hidden(display:none)

get attribute
displayed:False / enabled:True / readonly:None

Hidden(visibility:hidden)

get attribute
displayed:False / enabled:True / readonly:None

Result

Button click is_displayed is_enabled readonly note
normal OK True True None  
disabled NG True False None  
pointer-events:none Ex True True None  
readonly OK True True true  
display:none Ex False True None  
visibility:hidden Ex False True None  

Link

Inactive(disabled)

There is no “disabled" attribute for <a> tag. That is invalid.

Click event occurred
Click event occurred
displayed:True / enabled:True / readonly:None

Result

Link click is_displayed is_enabled readonly
normal OK True True None
disabled OK True True None
pointer-events:none Ex True True None
readonly OK True True true
display:none Ex False True None
visibility:hidden Ex False True None

Text

Inactive(disabled)

Exception occurred
Exception occurred
ElementNotInteractableExceptionMessage: Element <input id="textbox2" type="text"> is not reachable by keyboard
<traceback object at 0x000001A24CE10F08>

Hidden(display:none)

Exception occurred
Exception occurred
ElementNotInteractableExceptionMessage: Element <input id="textbox5" type="text"> is not reachable by keyboard
<traceback object at 0x000001A249B6EC88>

Result

Text send_keys get value is_displayed is_enabled readonly
noraml OK OK True True None
disabled Ex OK True False None
pointer-events:none OK OK True True None
readonly NG OK True True true
display:none Ex OK False True None
visibility:hidden Ex OK False True None

Select

Inactive(disabled)

“<select>" is disabled, but “option2" was selected.
Not selectable manually.

option2
option2

Inactive(pointer-events:none)

Exception occurred

Exception occurred
Exception occurred
ElementClickInterceptedExceptionMessage: Element <select id="select3"> is not clickable at point (831,564) because it does not have pointer events enabled, and element <div> would receive the click instead
<traceback object at 0x000001A24CE14848>

Hidden(display:none)

Exception occurred

Exception occurred
Exception occurred

An empty character is returned.

option item
option1~3:empty, option4:index out of range

Result

Select select item get selected item is_displayed is_enabled readonly note
normal OK OK True True None  
disabled OK* OK True False None *Not selectable manually
pointer-events:none Ex OK True True None  
readonly OK OK True True true  
display:none Ex NG* False True None *Empty is returned
visibility:hidden Ex NG* False True None *Empty is returned

Select(option)

Inactive(pointer-events:none)

“option2" is selected.

option2
option2

Hidden(display:none)

“option2" is hidden, but it can be selected.

option2
option2
option2 is hidden.
option2 is hidden.

“option2" is hidden, but “is_displayed()" is “True".

get attribute
displayed:True / enabled:True / readonly:None

Hidden(visibility:hidden)

“option2" is selected.

option2
option2

In Firefox, it seems that “visibility:hidden" is invalid for “option" of “<select>".

option2 is displayed.
option2 is displayed

Result

Select
(option)
select item get selected item is_displayed is_enabled readonly note
normal OK OK True True None  
disabled NG OK True False None  
pointer-events:none OK OK True True None  
readonly OK OK True True true  
display:none OK* OK True True None *Not selectable manually
visibility:hidden OK OK True True None  

 

Radio

Inactive(pointer-events:none)

Exception occurred
Exception occurred
ElementClickInterceptedExceptionMessage: Element <input id="radio_3" name="radio" type="radio"> is not clickable at point (800,389) because it does not have pointer events enabled, and element <div> would receive the click instead
<traceback object at 0x000001F89703BD48>

Hidden(display:none)

Exception occurred
Exception occurred
ElementNotInteractableExceptionMessage: Element <input id="radio_5" name="radio" type="radio"> could not be scrolled into view
<traceback object at 0x000001F89703B548>

You can check the radio by clicking label.

Radio_5=true
Radio_5=True

Result

Radio click button click label get value is_displayed is_enabled readonly
normal OK OK OK True True None
disabled NG NG OK True False None
pointer-events:none Ex OK OK True True None
readonly OK OK OK True True true
display:none Ex OK OK False True None
visibility:hidden Ex OK OK False True None

CheckBox

It was the same result as Radio.

Result

 

CheckBox click button click label get value is_displayed is_enabled readonly
normal OK OK OK True True None
disabled NG NG OK True False None
pointer-events:none Ex OK OK True True None
readonly OK OK OK True True true
display:none Ex OK OK False True None
visibility:hidden Ex OK OK False True None