Write the code for select the 5 values from drop down list.
drop down list having the 10 values.

Answers were Sorted based on User's Feedback



Write the code for select the 5 values from drop down list. drop down list having the 10 values...

Answer / pavani prasad

we can select more than one value from drop own list by
using "extendedselect" option

Browser(" ").Page("").WebList("").Select " first item"
Browser(" ").Page("").WebList("").extendeSelect "#1"
Browser(" ").Page("").WebList("").extendedSelect "#2"

Browser(" ").Page("").WebList("").extendedSelect "#3"

Browser(" ").Page("").WebList("").extendedSelect "#4"

or

if the items are consecutive, then

for i=0 to 4

Browser(" ").Page("").WebList("").extendedSelect ("#"&i)

if i am worng pls correct me

Is This Answer Correct ?    5 Yes 2 No

Write the code for select the 5 values from drop down list. drop down list having the 10 values...

Answer / ashish srivastava

Copy and paste the Below code

dim CountItem

countItem=Browser().Page().Weblist().GetROProperty("Itemcount")

For i = 1 to CountItem
Browser(). Page(). Weblist().Select i
if i >5 then
Browser(). Page(). Weblist().ExtentedSelect i
end If
Next

Is This Answer Correct ?    4 Yes 2 No

Write the code for select the 5 values from drop down list. drop down list having the 10 values...

Answer / deven

Set WShShell = CreateObject("WScript.shell")

WShShell.SendKeys "{Down}", True
WShShell.SendKeys "{Down}", True
WShShell.SendKeys "{Down}", True
WShShell.SendKeys "{Down}", True
WShShell.SendKeys "{Down}", True

WShShell.SendKeys "{Enter}"

Is This Answer Correct ?    3 Yes 1 No

Write the code for select the 5 values from drop down list. drop down list having the 10 values...

Answer / deven

Dim cMethodcount,cme

cMethodcount = Browser("IAS").Page("IAS").Frame("WorkFrame").WebList("CalcMethod").GetROProperty("items Count")

For cme = 1 to cMethodcount -1

Browser("IAS").Page("IAS").Frame("WorkFrame").WebList("CalcMethod").Select(cme)

If Instr(Browser("IAS").Page("IAS").Frame("WorkFrame").WebList("CalcMethod").GetROProperty("selection"),datatable.Value("CalculationMethod","dtAManagement")) Then

Exit for

End If

Next

Is This Answer Correct ?    2 Yes 1 No

Write the code for select the 5 values from drop down list. drop down list having the 10 values...

Answer / balaji

For eg:If the weblist contains some x no. of values and if
we want to select only 10 out of it then


i=browser(..).Page(..).weblist(...).Getitemscount()

For j=0 to i
if j<5 then
browser(..).Page(..).weblist(...).select j

end if
next

This code will retrieve only the first 5 values

Is This Answer Correct ?    2 Yes 5 No

Write the code for select the 5 values from drop down list. drop down list having the 10 values...

Answer / ram

Hi, I think if the object is dropdown(Combobox) we cannot select more than one value at a time.


please let me know if I am wrong.


Thanks in advance.


Ram

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More QTP Interview Questions

How do i relate the checkbox properties with webelement when checkbox properties are changing on every login to the application

1 Answers   TCS,


I am in need of some set of QTP FAQ @ interview. Also recently in one of interview portal they asked me how you write the script for Login application which it is web -based and using Descriptive Programming? Without associating the shared object repository?Please i do need this answer very soon? Please respond me soon @ vaisu72@yahoo.com

2 Answers  


How we can test a Frame in a web page?

1 Answers   eMids,


Define Error Pane of UFT?

0 Answers  


Using Object Repository is a advantage or disadvantage?

6 Answers   Wipro,


Give me some real time point of way where exactly we can conduct audits?

0 Answers   CTS,


w is configaration management

3 Answers   TCS,


How to execute the test cases using QTP. i.e What is the use of QTP while execution

2 Answers  


How to save your test using quicktest professional?

0 Answers  


hi nani my doubt is how does qtp process metrix related to software process.

0 Answers  


What are the major/ important methods, functions in QTP we use realtime testing

0 Answers  


how to i add the values using the check points property?( i.e valid data(for valid data it's giving the footer message:value is added) and for invalid data: special chars, spaces,Duplicates and null values (in my page when ever we enter special chars, spaces and null values, it's giving the proper warning message and for Duplicates it's giving the footer message:"value already exists)?

0 Answers  


Categories