Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to calculate total no of Edit box
#1
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi i am testing following web site.
http://newtours.demoaut.com

username-tutorial
password - tutorial

here on the first page if we select 2 passangers, by clicking on continue go the second and third page.

Here on the third page under 'Passenger' frame two Edit box appears for 2 passengers as we select 2 pasenger on first page.

If we select 3 passanger, then on third page 3 edit boxes appear as we select 3 on first page.

I want varify this for. Means want to calculate edit box.

Thanks in advance.
Reply
#2
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi,

Use the "childobjects" method & retrieve the collection of "Edit" boxes & then find out the count of that collection ....

you can calculate easily......
Reply
#3
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi
Pls capture the no of passengers selected in first page in to a variable(NoOfPassSelected)
Now in third page,below code can be used.

Code:
For iLoop = 1 to NoOfPassSelected

Browser("title:=Book a Flight: Mercury Tours").Page("title:=Book a Flight: Mercury Tours").WebEdit("name:=Passfirst"&iLoop).Set = "Passfirst"&iLoop

Browser("title:=Book a Flight: Mercury Tours").Page("title:=Book a Flight: Mercury Tours").WebEdit("name:=Passlast"&iLoop).Set = "Passlast"&iLoop

Next
This will work for any no of Passengers selected.
Reply
#4
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi,

Add the object in OR...dont forget to add name property for it...

Code:
counter=0

While Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").WebEdit("passFirst0").Exist(2)
    counter = counter + 1
    Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").WebEdit("passFirst0").SetTOProperty "name","passFirst"&counter
Wend

MsgBox counter
Reply
#5
Solved: 11 Years, 4 Months, 4 Weeks ago
Hello Prafulla,

I didn't get you, Why are you changing the value in OR? I mean what is the need? already application providing passFirst0,passFirst1...etc., We need just no. of Edit boxes with this names... I hope no need to use SetToProperty here...

Please explain your code....

Thanks & regards,
Baba Fakruddin.D
baba.fakru@gmail.com
Reply
#6
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi bfakruddin

u r rt..already application providing passFirst0,passFirst1.. n i m using the same...if u r using OR then tht solution s useful..
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Not able to set value in application web edit box tanuj dewangan 4 3,772 07-29-2016, 03:58 PM
Last Post: harshadevadas
  This code does not give total no of links present on page plz help it returns 0 excellentpawan 8 5,721 01-17-2015, 07:49 PM
Last Post: yogi4tech
  Edit Recovery Scenario skegler 0 3,302 03-05-2014, 10:40 PM
Last Post: skegler
  Not able to edit existing scripts in QTP 11 prit deo 1 4,086 02-14-2014, 11:20 PM
Last Post: supputuri
  I want to count total no of links in a page and click one by one excellentpawan 9 7,335 07-23-2013, 11:51 AM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)