Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Conditional Statement (If.......else)
#1
Not Solved Exclamation 
hi.......

In my application, the values changes dynamically in fields.....so i tried to use the concept of conditional statements........

Say for eg: Have a field named as customer,...By default, the drop down list contains "select...and Add new"..when ever user adds the customer in add new, the value changes dynamically..How can i overcome this using descriptive programming of QTP.

The following conditions be applied for this scenario......
1.Once the customer name is added in add new, second time i want to select the add new and add another customer(in different name) at run time.. This has to repeated for six customers..
2.If add new field shows "This customer name already exists" then i have to add some other customer in variant name...
3. If six customers gets added in add new, i want to select customers randomly from the drop down without trying for add new.....

Help me out....
Reply
#2
Not Solved
Get me a solution..........

Reply
#3
Not Solved
is the position of 'Add New' remains the same in the list or does it keeps changing also

e.g.
1. I am assuming that the fist time the list looks like
Select a Value
Add New
2. When I have added 'Tarun' using add new, the second time the list should be
Select a Value
Tarun
Add New
3. If I add a new value as Rajesh then the list should be
Select a Value
Rajesh
Tarun
Add New

please confirm

Reply
#4
Not Solved
Ya the same concept
Reply
#5
Not Solved
Use the following code to add six new customers

Code:
If DataTable.Value("Customer",dtGlobal) = "New"
   Browser.Page.WebList.Select "Add New"
   Code to add a new customer goes here
Else
   Browser.Page.WebList.Select DataTable.Value("Customer",dtGlobal)
   Code after selecting the customer goes here
End IF

Assumptions:

1. You have a column, named "Customer", in the global sheet
2. The first six enteries in this column are "New" (to create a new customer)
3. The enteriers after 6 are the customer names, in random order, which we have added in first 6 iterations.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding Conditional Statements in Keyword driven automation framework prachisharma76 0 3,841 09-14-2010, 11:00 AM
Last Post: prachisharma76
  Executing statement and commiting statement via qtp unbeliever 6 20,636 01-07-2010, 07:11 PM
Last Post: unbeliever

Forum Jump:


Users browsing this thread: 1 Guest(s)