How to handle Alert box, Pop ups and splash screens using JAVA for Android?

Hi,
I have to skip the alerts, popups and splash screens, when I m getting page source of the main activity. I just need to bypass all the alerts, popups and splash, loading screens. how to do that ?

Thank you.

I think you have to handle Alerts n popups and its very easy to handle them but not sure how to handle splash screens

Hi,
I have the same issue. Can you please specify a method other than below?

  1. driver.switchTo().alert();
  2. driver.elementByXPath
  3. 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 suggetion would be appreciated, thanks.