Hi guys,
I have a situation which is giving me a lot of troubles.
I have two conditions to be done, for e.g:
I have a table of e.g. 15 rows and two columns: oRow = 15
also each row have it's text: strText = "textFromRow"
to get the text I am using GetCellData:
-- on the second column I have the values of the names from 1st columns.
the idea is that I need a while statement I think (not sure), where to add the condition:
the conditions are:
the idea is that when 1st condition gets passed (If strText = "Less Client account (FIU)"), than we should get a report message(PASS), if not than it should do i+1 while i=oRow-1 (max nr of rows within the table) and give us an error report message.
what I am doing here inside the code(I am trying to do) is:
count all rows, then to increase row's nr i=1 while the necessary text will be equal with the text from that row and also to do this while maximum times = count nr.
please can anyone help me with that?
I have a situation which is giving me a lot of troubles.
I have two conditions to be done, for e.g:
I have a table of e.g. 15 rows and two columns: oRow = 15
also each row have it's text: strText = "textFromRow"
to get the text I am using GetCellData:
Code:
Browser("URL:=" &Environment.Value("baseUrl")).Page("URL:=" &Environment.Value("baseUrl")).WebTable("micclass := WebElement", "class := ledgerAvlb_box_right", "Html Tag := TD", "Text := Sales Ledger (SLC + SLCX).*", "Index:=8").GetCellData("6","1")
the idea is that I need a while statement I think (not sure), where to add the condition:
Code:
'counting the rows
oRow = Browser("URL:=" &Environment.Value("baseUrl")).Page("URL:=" &Environment.Value("baseUrl")).WebTable("micclass := WebElement", "class := ledgerAvlb_box_right", "Html Tag := TD", "Text := Sales Ledger (SLC + SLCX).*", "Index:=8").RowCount
' increasing the value of i to oRow
For i = 0 to i = oRow - 1
' get the data from cell(i) to find if it is the same as we need
strText = Browser("URL:=" &Environment.Value("baseUrl")).Page("URL:=" &Environment.Value("baseUrl")).WebTable("micclass := WebElement", "class := ledgerAvlb_box_right", "Html Tag := TD", "Text := Sales Ledger (SLC + SLCX).*", "Index:=8").GetCellData(i,"1")
' comparing the data from cell(i)
' 1st condition - if it's pass we shouldn't continue the second one
If strText <> "Less Client account (FIU)" then
' the second condition
While i <> oRow - 1 Do i = i + 1 Until
Loop Until strText <> "Less Client account (FIU)"
Loop While i <> oRow - 1
strText = Browser("URL:=" &Environment.Value("baseUrl")).Page("URL:=" &Environment.Value("baseUrl")).WebTable("micclass := WebElement", "class := ledgerAvlb_box_right", "Html Tag := TD", "Text := Sales Ledger (SLC + SLCX).*", "Index:=8").GetCellData(i,"1")
Else
' get the value of the second cell from the "Less Client account (FIU)" column
New_LessClientAccountFIU_Value = Browser("URL:=" &Environment.Value("baseUrl")).Page("URL:=" &Environment.Value("baseUrl")).WebTable("micclass := WebElement", "class := ledgerAvlb_box_right", "Html Tag := TD", "Text := Sales Ledger (SLC + SLCX).*", "Index:=8").GetCellData(i,"2")
Reporter.ReportEvent micPass, "PASS", "The item '" & strText & "' exists on the screen, and it's value is: '" & New_LessClientAccountFIU_Value & "'!"
End IF
the conditions are:
the idea is that when 1st condition gets passed (If strText = "Less Client account (FIU)"), than we should get a report message(PASS), if not than it should do i+1 while i=oRow-1 (max nr of rows within the table) and give us an error report message.
what I am doing here inside the code(I am trying to do) is:
count all rows, then to increase row's nr i=1 while the necessary text will be equal with the text from that row and also to do this while maximum times = count nr.
please can anyone help me with that?