Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to use looping statement
#1
Solved: 7 Years, 1 Month, 2 Weeks ago
Hi, Good day to all, currently using UFT v14

I wanted to loop lines 1-13 using the data table which has 6 rows then after that run lines 14-16 once.
What statement would be best to use? currently it runs 6 times login to logout. Thanks in advance for your comments


Code:
1. Browser("VMware Service Manager").Page("VMware Service Manager").Link("Log a Call").Click
2. Browser("VMware Service Manager").Page("VMware Service Manager").Link("APAC").Click
3. Browser("VMware Service Manager").Page("VMware Service Manager").WebList("EXTFLDV_500064").Select DataTable.Value("EXTFLDV_500064", "Action1") 
4. Browser("VMware Service Manager").Page("VMware Service Manager").WebEdit("Contact_No").Set DataTable.Value("Contact", "Action1") 
5. Browser("VMware Service Manager").Page("VMware Service Manager").WebList("URGENCY_REF").Select DataTable.Value("URGENCY_REF", "Action1") 
6. Browser("VMware Service Manager").Page("VMware Service Manager").WebList("IMPACT_REF").Select DataTable.Value("IMPACT_REF", "Action1") 
7. Browser("VMware Service Manager").Page("VMware Service Manager").WebEdit("EXTFLDV_400136").Set DataTable.Value("EXTFLDV_400136", "Action1")
8. Browser("VMware Service Manager").Page("VMware Service Manager").WebEdit("HTMLTEXTAREA_PROBLEM_DESC").Set DataTable.Value("HTMLTEXTAREA_PROBLEM_DESC", "Action1")
9. Browser("VMware Service Manager").Page("VMware Service Manager").WebButton("Submit").Click
10.  If Browser("VMware Service Manager").Page("VMware Service Manager").WebElement("innertext:=A new call has been logged with the following details:").Exist(4)Then 
11.    Browser("VMware Service Manager").Page("VMware Service Manager").Link("Log a Call").Click
12. End If
13. Wait(2)
14. Browser("VMware Service Manager").Page("VMware Service Manager").Link("Log Out").Click
15. Browser("VMware Service Manager").Page("VMware Service Manager").WebButton("OK").Click
16. Browser("VMware Service Manager").CloseAllTabs
Reply


Messages In This Thread
how to use looping statement - by dmvelic083185 - 09-26-2017, 12:43 PM
RE: how to use looping statement - by Ankur - 09-26-2017, 08:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Excel_Datasheet Looping problem Saadat Chowdhury 0 1,737 10-05-2012, 08:42 AM
Last Post: Saadat Chowdhury
  problem in looping statements... navyasatish 5 4,189 02-02-2012, 02:23 PM
Last Post: rajpes
  Looping wont stop laura 3 3,180 07-06-2009, 02:11 PM
Last Post: basanth27
  Looping and seting value laura 5 3,698 07-03-2009, 01:13 PM
Last Post: Ankur
  Code won't stop looping through imported spreadsheet Mike72688 6 5,735 01-08-2009, 07:21 PM
Last Post: Mike72688

Forum Jump:


Users browsing this thread: 1 Guest(s)