07-01-2011, 06:59 PM
Thx Parminder,
I do not get an error, but ...
First,
I changed my code. The first If stement (when no data is retevied) works fine. But the second If statement Still goes to fail even though data is present on the page. I get a warning stating that
Warning or Fail
"If Browser("Wisdom").Page("Wisdom IA").Frame("parent").WebElement("No Results Found").GetROProperty("visible") = True Then" is not found.
My code gives me a warning or fails when WebElement("No Results Found") is not found. My goal is to check if the WebElement("No Results Found") is displayed, if it is then use today's date minus one day. Then check again if WebElement("No Results Found") is visible.
But if WebElement("No Results Found") is not visible (as data is present), my code still marks as Fail.
How can I better check for the message ("No Results Found")? and continue if not found.
Second,
My date code:
TodayDate = DateAdd("d",-1,Now())
eDate = FormatDateTime(TodayDate,2)
returns 7/1/2011, but this fails as the program only alows mm/dd/yyyy (so, Im need 07/01/2011) or I get an error message.
My code:
I do not get an error, but ...
First,
I changed my code. The first If stement (when no data is retevied) works fine. But the second If statement Still goes to fail even though data is present on the page. I get a warning stating that
Warning or Fail
"If Browser("Wisdom").Page("Wisdom IA").Frame("parent").WebElement("No Results Found").GetROProperty("visible") = True Then" is not found.
My code gives me a warning or fails when WebElement("No Results Found") is not found. My goal is to check if the WebElement("No Results Found") is displayed, if it is then use today's date minus one day. Then check again if WebElement("No Results Found") is visible.
But if WebElement("No Results Found") is not visible (as data is present), my code still marks as Fail.
How can I better check for the message ("No Results Found")? and continue if not found.
Second,
My date code:
TodayDate = DateAdd("d",-1,Now())
eDate = FormatDateTime(TodayDate,2)
returns 7/1/2011, but this fails as the program only alows mm/dd/yyyy (so, Im need 07/01/2011) or I get an error message.
My code:
Code:
CurrentRow = DataTable.GlobalSheet.GetCurrentRow
ACCT = Datatable("ACCT1", dtGlobalSheet)
ENV = Datatable("ENV", dtGlobalSheet)
If Browser("Wisdom").Page("Wisdom IA").Frame("parent").WebElement("No Results Found").GetROProperty("visible") = True Then
'No data found for EndDate in ENV
eDate = DateAdd("d",-1,Now())
eDate = FormatDateTime(eDate,2)
'Try secondary End Date (Today minus 1 day)
Browser("Wisdom").Page("Wisdom IA").Frame("parent").Image("button_newsearch").Click
Browser("Fax Request").Page("Preferences").WebEdit("EndDate").Set eDate
Browser("Fax Request").Page("Preferences").WebElement("SearchPrefPage").Click
If Browser("Wisdom").Page("Wisdom IA").Frame("parent").WebElement("No Results Found").GetROProperty("visible") = True Then
Reporter.ReportEvent micFail,"No Data found for Row: " & CurrentRow & " The Account Number: " & ACCT & " in the ENV: " & ENV & " - has no Data."
ExitTest
Else
'data found for EndDate in ENV
Reporter.ReportEvent micPass, "Data found for Row: " & CurrentRow & " The Account Number: " & ACCT & " in the ENV: " & ENV & " - has Data."
End If
Else
'data found for EndDate in ENV
Reporter.ReportEvent micPass, "Data found for Row: " & CurrentRow & " The Account Number: " & ACCT & " in the ENV: " & ENV & " - has Data."
End If