adding two conditions into a while statement - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: adding two conditions into a while statement (/Thread-adding-two-conditions-into-a-while-statement) |
adding two conditions into a while statement - lotos - 09-20-2010 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: 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 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? RE: adding two conditions into a while statement - KavitaPriyaCR - 10-07-2010 Hi Here i am understanding your question, 1. There is table with 15 X 2 (15 Rows X 2 Columns) 2. Select the cell value from 1st column 1st row. 3. Compare the data fetched in the step 2 with "Less Client account (FIU)" 4. If it is not equal then go on to next row till 15th row. 5. At the end of 15th row, if the text not found, log error report message. Am i correct? Is this waht exactly you need? pls Let me know, i will try to answer. RE: adding two conditions into a while statement - lotos - 10-07-2010 Hi Kavita, yep you're right. RE: adding two conditions into a while statement - KavitaPriyaCR - 10-08-2010 Then try this, I am taking the rCount and cCount as 2 and 15 as table is of fixed size else take the counts. Code: StrToCompare="Less Client account (FIU)" RE: adding two conditions into a while statement - lotos - 11-10-2017 (10-08-2010, 10:27 AM)KavitaPriyaCR Wrote: Then try this, I am taking the rCount and cCount as 2 and 15 as table is of fixed size else take the counts. Thank you KavitaPriyaCR, I'll try it and will let you know. |