How to find the "texts" in a Web page which is having no resources

Hi i am writing a script in browser which the message “server not found” is shown it should display a message called " connect to wifi "

@Test
public void f() throws InterruptedException {
dr.startActivity(“org.mozilla.firefox”, “org.mozilla.firefox.App”);
Thread.sleep(1000);
WebElement k = dr.findElement(By.id(“org.mozilla.firefox:id/url_bar_entry”));
k.click();
k.sendKeys(“www.msn.com”);
dr.sendKeyEvent(AndroidKeyCode.ENTER);
while (dr.scrollTo(“Server not found”).isDisplayed()){
System.out.println(" connect to wifi please ");
}

there is no id found for “Server not found” page

suggest me how can i take the text in the page to access

Advance thanks…