I answer myself. According to the post on click home icon with espresso, It is not possible to specify an Id
for the Home button in ActionBar, at least the with version 7 of the Support library, so we should use "Navigate up". But why?
This is the reason thanks to the Espresso error trace:
--------> ActionMenuView
{
id=-1, visibility=VISIBLE, width=144, height=168, has-focus=false,
has-focusable=true, has-window-focus=true, is-clickable=false,
is-enabled=true, is-focused=false, is-focusable=false,
is-layout-requested=false, is-selected=false, root-is-layout-requested=false,
has-input-connection=false, x=936.0, y=0.0, child-count=1
}
|
--------> ActionMenuItemView
{
id=2131296554, res-name=general, desc=, visibility=VISIBLE,
width=144, height=144, has-focus=false, has-focusable=true,
has-window-focus=true, is-clickable=true, is-enabled=true,
is-focused=false, is-focusable=true, is-layout-requested=false,
is-selected=false, root-is-layout-requested=false,
has-input-connection=false, x=0.0, y=12.0, text=, input-type=0, ime-target=false
}
|
--------> ImageButton
{
id=-1, desc=Navigate up, visibility=VISIBLE, width=168, height=168,
has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true,
is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false,
is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0
}
|