Hi,
I have the same issue about not being able to select alerts on different Android fragments. Can you please specify a method other than below?
driver.switchTo().alert();
driver.elementByXPath
driver.elementById
I tried all of these options and still did not get a result in the following structure:
<android.widget.FrameLayout>
<android.widget.LinearLayout>
<android.widget.FrameLayout resource-id="android:id/content">
<android.widget.LinearLayout>
<android.widget.ImageView resource-id="xx/iv_custom_alert_icon">
<android.widget.TextView resource-id="xx/tv_custom_alert_title">
<android.widget.TextView resource-id="xx/tv_custom_alert_subtitle">
<android.widget.LinearLayout>
<android.widget.TextView resource-id="xx/v_custom_alert_positive">
alternative suggestions would be appreciated, thanks.