i am giving.multiple names like ram,raj,san etc....pls enter & search these names in google pade edit box through script...
i told to interviewer, using Ms excel & test easily..but interviwer not happy with that answer?

Answers were Sorted based on User's Feedback



i am giving.multiple names like ram,raj,san etc....pls enter & search these names in google pade..

Answer / manjunathareddy

SystemUtil.Run "iexplore.exe","www.google.com"

Arr=Array("ram","raj","san")

For i=LBound(Arr) to UBound(Arr)
Browser("name:=Google").Page("title:=Google").WebEdit("name:=q").Set Arr(i)
Browser("name:=Google").Page("title:=Google").WebButton("name:=Google Search","type:=button").Click
Browser("name:=.*").Close
Next

Is This Answer Correct ?    3 Yes 0 No

i am giving.multiple names like ram,raj,san etc....pls enter & search these names in google pade..

Answer / mithuna reddy

Hi Manjunath, done some modifications to your script
please let me know if it is wrong after the first iteration of For loop when the browser object is close the second iteration would throw an error, so I have put SystemUtil in For loop

Arr=Array("ram","raj","san")

For i=LBound(Arr) to UBound(Arr)
SystemUtil.Run "iexplore.exe","www.google.com"
Browser("name:=Google").Page("title:=Google").WebEdit("name:=q").Set Arr(i)
Browser("name:=Google").Page("title:=Google").WebButton("name:=Google Search","type:=button").Click
Browser("name:=.*").Close
Next

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More QTP Interview Questions

Is there any vbscript in QTP for Data Driven Test instead of using the option provided by QTP?

2 Answers  


how to test background color and dynamic images during runtime

4 Answers   CTS,


How to switch between browser tabs? )moving from one tab to another tab)

1 Answers   CTS,


How to execute a WinRunner Script in QTP?

3 Answers   IBM,


waht is the diff b/w Environment variable and Global variable in qtp?? explain types of variable in qtp??

5 Answers  






what is difference betweein qtp 9.0 and 9.2

1 Answers  


Could we use QTP for java project(Which is develop in Netbeans and My SQL) otherwise which one is suitable?

1 Answers  


write a qtp script to verify that the business price is twice the economy price in flight reservation window

1 Answers  


Write VB script to test given number is Prime Number

5 Answers   Oracle,


How to change the run-time value of a property for an object?

3 Answers   Crea,


write a script for allinterview-submit Question first we've to select Choose Category,second select Sub- Category(Which is comes in to runtime)third select Question Type.for that give some descriptive and vb script

0 Answers  


Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?

0 Answers  


Categories