How Selenium works(input exceptions/5:IE)

2020-07-29

Overview

Test Page

Internet Explorer

11.973.17763.0
Version 11.973.17763.0

Behavior of click() method

In IE, the click method does not work simply.
The first click gives the control focus, and the second click raises the click event.

The first click sets the focus to the control.

get focus
First click

The second click raises the click event.

clickable
Second click

Zoom

In IE, click the Tools button, select Zoom in the menu and tap Custom in the sub-list.

type “90"

Button

submit

It is not clickable. The control does not get focus.

No response
No response

is_enabled()=Ture

is_displayed()=True
is_displayed()=True

Link

It is not clickable.

No response
No response

Text

Enterable

send_keys
sendkeys

Select

Selectable

option2
option2

Radio / CheckBox

Not clickable

No response
No response

The label is not clickable.

No response
No response

Execution result

Control Element Operate Result
Button submit click NG
button click NG
image click NG
Link normal click NG
img click NG
css click NG
Text textbox send_key OK
password send_key OK
textarea send_key OK
Select select select OK
Radio radio click NG
label click NG
CheckBox checkbox click NG
label click NG

Hidden element

Click “child2" in the pull-down menu.

pull-down-menu

Menu

An exception occurs.

exception
exception
ElementNotInteractableExceptionMessage: Element is not displayed
<traceback object at 0x0000012DBE081648>

is_displayed()=False

is_displayed()=False
is_displayed()=False

Another element hides the element

Modal dialog

Click “Menu1" to display the JavaScript Alert dialog.
The Alert dialog is modal.

alert dialog
Alert dialog with normal

There are two types of dialogs in IE on Windows10. The dialog will be displayed with a checkbox when displayed several times.

That has a checkbox and the following message.
“Don’t let this page create more messages"

alert dialog with checkbox
Alert dialog with checkbox

Button

The result is different between “with normal" and “with checkbox".

Dialog with normal

If Selenium clicks the “submit" while the Alert dialog is displayed, the dialog will close and an exception will occur.

alert dialog with normal
with normal
exception
exception
UnexpectedAlertPresentExceptionAlert Text: Menu1!
Message: Modal dialog present with text: Menu1!
<traceback object at 0x0000012DBE0AE848>

Selenium cannot get the element. An exception occurs.

with checkbox

If Selenium clicks the “submit" while the Alert dialog is displayed, the dialog will close and a click event will occur.

alert dialog with checkbox
with checkbox
clickable
clickable

It is clickable if the element is hidden.

alert dialog with checkbox
Hidden element
clickable
clickable

With manual operation, you cannot click “submit" and the dialog will not close.

Not clickable
Not clickable

Link

with normal

An exception occurs.

alert dialog with normal
with normal
exception
exception
with checkbox

It is clickable.

alert dialog with checkbox
with checkbox
clickable
clickable

Text

with normal

An exception occurs.

alert dialog with normal
with normal
exception
exception
with checkbox

Enterable

alert dialog with checkbox
with checkbox
send_keys
send_keys

Select

with normal

An exception occurs.

alert dialog with normal
with normal
exception
exception
with checkbox

Selectable

alert dialog with checkbox
with checkbox
option2
option2

Radio / CheckBox

with normal

An exception occurs.

alert dialog with normal
with normal
exception
exception
with checkbox

Clickable

alert dialog with checkbox
with checkbox
Radio_3
clickable

Execution result

Alert dialog with normal

The dialog will close and an exception will occur.

Contorl Element Operate Result
Button submit click Ex
button click Ex
image click Ex
Link normal click Ex
img click Ex
css click Ex
Text textbox send_key Ex
password send_key Ex
textarea send_key Ex
Select select select Ex
Radio radio click Ex
label click Ex
CheckBox checkbox click Ex
label click Ex

Selenium cannot get the element.
The dialog closes.

Alert dialog with checkbox on Window10

The dialog will close and an event will occur.

Control Element Operate Result
Button submit click OK
button click OK
image click OK
Link normal click OK
img click OK
css click OK
Text textbox send_key OK
password send_key OK
textarea send_key OK
Select select select OK
Radio radio click OK
label click OK
CheckBox checkbox click OK
label click OK

confirm / prompt dialog

Javascript has a confirm dialog and a prompt dialog. But the result was different from the Alert dialog.

confirm dialog

An exception occurs in both “with normal" and “with checkbox".

with normal
confirm dialog with normal
confirm dialog with normal
exception
exception
with checkbox
confirm dialog with checkbox
confirm dialog with checkbox
exception
exception

prompt dialog

An exception occurs in both.

with normal
prompt dialog with normal
prompt dialog with normal
exception
exception
with checkbox
prompt dialog with checkbox
prompt dialog with checkbox
exception
exception

Modeless dialog

Click “Menu2" to display the jQuery Modeless dialog.

dialog

Button

submit

With the dialogs overlapping, click the “submit".
An exception occurs.

exception
exception
ElementClickInterceptedExceptionMessage: Element not clickable at point (832,367). Other element would receive the click: <p>This dialog is specfied "z-index:999".<br>
  
<traceback object at 0x000002470A8BBD48>

Move the dialog to show the “submit", then click. It is clickable.
But In IE, the first click gives the control focus, and the second click raises the click event.

clickable
clickable

You can click it manually.

clickable
clickable

is_displayed()=True

is_displayed()=True
is_displayed()=True

Link

Selenium cannot click if the element is hidden.

Text

It is enterable if the element is hidden.

send_keys
send_keys
hoge
hoge

Select

It is selectable if the element is hidden.

option2
option2
option2
option2 is selected

Radio / CheckBox

It is not clickable if the element is hidden.

Execution result

Control Element Operate Result
Button submit click Ex
button click Ex
image click Ex
Link normal click Ex
img click Ex
css click Ex
Text textbox send_key OK
password send_key OK
textarea send_key OK
select   select OK
radio radio click Ex
label click Ex
checkbox checkbox click Ex
label click Ex

Ex: An exception occurs if the element is hidden with the dialog overlapping.

Header/Footer

The header/footer is sticky. Those are scroll follow type.

Button

submit

Press “click" in CodeChecker while the “submit" is hidden with the header overlapping.
An exception occurs.

exception
exception
ElementClickInterceptedExceptionMessage: Element not clickable at point (832,86). Other element would receive the click: <a id="menu2" onclick="show_dialog()" href="#nav_sample">Menu2</a>
<traceback object at 0x0000027BE1149048>

is_displayed()=True

is_displayed()=True
is_displayed()=True

Link

Press “click" in CodeChecker while the “Link" is hidden with the header overlapping.
An exception occurs.

exception
exception

Text

textbox

It is enterable if the element is hidden.

send_keys
send_keys
hoge
hoge
Select

Selectable

option2
option2
option2
option2 is selected

Radio / CheckBox

Press “click" in CodeChecker while the “radio_3" is hidden with the fotter overlapping.
An exception occurs.

exception
exception

Execution result

Control Element Operate Result
Button submit click Ex
button click Ex
image click Ex
Link normal click Ex
img click Ex
css click Ex
Text textbox send_key OK
password send_key OK
textarea send_key OK
Select select select OK
Radio radio click Ex
label click Ex
CheckBox checkbox click Ex
label click Ex