Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not going to Else (False) statement
#1
Solved: 11 Years, 4 Months ago
This seems to work. But if my browser is "Page not Found" ie the webserver is down, etc, the path in my code still goes to the "If" statement (True), and not to the "Else" (False).

Can I get a look at my code to see why, the Else (False) is not sellected, even though the web server is clearly down?

My code:-)

Code:
Browser("Wisdom").Page("WisdomLogin").WebElement("Welcome to Wisdom").WaitProperty "visible", True, 5000

If Browser("Wisdom").Page("WisdomLogin").WebElement("Welcome to Wisdom").GetROProperty("visible") Then  'Gets stuck here when "The page cannot be displayed"
       ''Browser Opened successfully in URL
       Reporter.ReportEvent micPass, "Browser in URL: " & DataTable.GlobalSheet.GetCurrentRow, "URL: " & " - opened SUCCESFULLY."
Else
       'Browser Failed to open in URL
        Reporter.ReportEvent micFail,"Browser in URL: " & DataTable.GlobalSheet.GetCurrentRow, "URL: " & " - opened UNSUCCESFULLY."
        Browser("Wisdom").Close
        ExitTest
End If
Should I change:

Code:
Valid = Browser("Wisdom").Page("WisdomLogin").WebElement("Welcome to Wisdom").WaitProperty "visible", True, 5000

If Valid Then 'Gets stuck here when "The page cannot be displayed"
Reply


Messages In This Thread
Not going to Else (False) statement - by mv8167 - 06-17-2011, 06:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Exist returns false with part of innertext Milindt43 1 2,947 02-23-2011, 09:56 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)