GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 87 of 677    Print  
how can i write a script to automate the page which contains random questions with corresponding answers as radio buttons
eg:
questions1............
a b c d
question 2
a b c d
........
......

  
Total Answers and Comments: 1 Last Update: January 28, 2006     Asked by: srikanth 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: saurabhdeswaltavant
 

how can i write a script to automate the page which contains random questions with corresponding answers as radio buttons
eg:
questions1............
a b c d
question 2
a b c d
........
......

ACTUAL_ANS(0) = "2"
ACTUAL_ANS(0) = "1"
ACTUAL_ANS(0) = "3"
ACTUAL_ANS(0) = "4"


RANDOM_ANS(I) = ANY RANDOM NO THROUGH RANDOMIZE FN RANGE BETWEEN 1 TO 4

Browser("QUIZ").Page("QUIZ_PAGE").WebRadioGroup("FIRSTQN").Select "#"&RANDOM_ANS(0)
Browser("QUIZ").Page("QUIZ_PAGE").WebRadioGroup("SECONDQN").Select "#"&RANDOM_ANS(1)
Browser("QUIZ").Page("QUIZ_PAGE").WebRadioGroup("THIRDQN").Select "#"&RANDOM_ANS(2)
Browser("QUIZ").Page("QUIZ_PAGE").WebRadioGroup("FOURTHQN").Select "#"&RANDOM_ANS(3)


VALIDATE FOR ALL THE ANSWERS IN THAT ARRAY IN A LOOP

FOR LOOP
IF RANDOM_ANS(I) = ACTUAL_ANS(I)
GOOD_ANWSERED = GOOD_ANWSERED + 1
END IF
MSGBOX GOOD_ANWSERED ARE THE SCORE !!!
NEXT

BY

V-know-th



Above answer was rated as good by the following members:
Ritik1008
January 28, 2006 03:47:25   #1  
saurabhdeswaltavant Member Since: December 2005   Contribution: 10    

RE: how can i write a script to automate the page whic...

how can i write a script to automate the page which contains random questions with corresponding answers as radio buttons
eg:
questions1............
a b c d
question 2
a b c d
........
......

ACTUAL_ANS(0) = "2"
ACTUAL_ANS(0) = "1"
ACTUAL_ANS(0) = "3"
ACTUAL_ANS(0) = "4"


RANDOM_ANS(I) = ANY RANDOM NO THROUGH RANDOMIZE FN RANGE BETWEEN 1 TO 4

Browser("QUIZ").Page("QUIZ_PAGE").WebRadioGroup("FIRSTQN").Select "#"&RANDOM_ANS(0)
Browser("QUIZ").Page("QUIZ_PAGE").WebRadioGroup("SECONDQN").Select "#"&RANDOM_ANS(1)
Browser("QUIZ").Page("QUIZ_PAGE").WebRadioGroup("THIRDQN").Select "#"&RANDOM_ANS(2)
Browser("QUIZ").Page("QUIZ_PAGE").WebRadioGroup("FOURTHQN").Select "#"&RANDOM_ANS(3)


VALIDATE FOR ALL THE ANSWERS IN THAT ARRAY IN A LOOP

FOR LOOP
IF RANDOM_ANS(I) = ACTUAL_ANS(I)
GOOD_ANWSERED = GOOD_ANWSERED + 1
END IF
MSGBOX GOOD_ANWSERED ARE THE SCORE !!!
NEXT

BY

V-know-th


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Operates stand-alone, or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation “zero-configuration” Keyword Driven testing technology in QuickTest 
Latest Answer : Object spy is used in QTP for Descriptive Programming. to Identify the Object properties ...

What are the properties you would use for identifying a browser & page when using descriptive programming ?

Latest Answer : font color change?font size?how can we save data in excel file?how can we open excel file at run time?how can we fetch data from excel file? ...

How to do the scripting.  Is there any inbuilt functions in QTP as in QTP-S.  Whatz the difference between them?  how to handle script issues? 

Which feature of QTP would you like to improve ?How would you go about implementing it ?(This question is only to test the candidate, I dont expect any strong answers. How should be able to convince the interviewer, thats it.)
Read Answers (1) | Asked by : Rahul Rathan

Latest Answer : The Test Automation Engineer takes the Keyword Name, Description, Parameters, Application Under Test, and Keyword development standards and constructs the Keyword. If there are any issues with the design aspects of the Keyword the Automation Engineer ...
Read Answers (1) | Asked by : Rahu Rathan

If a error occur during the excution of QTP script. how can we get the name of the current object that cause the error
Read Answers (4) | Asked by : asha

How can we write scripts without having GUI(means u dont have any GUI and u want to write a script in QTP)?
no answer 
Read Answers (13) | Asked by : deepti

Latest Answer : QTP provides the Active Screen Technology i.e it will take snapshots of the Application when you are going thru' the appl. by using the snapshots you will be able to write the script for that particular appl. ...
Read Answers (5) | Asked by : deep

Latest Answer : Execute File statement can be included as part of the test script inorder to execute the vbs files. ...
Read Answers (2) | Asked by : ramesh


 Sponsored Links

 
Related Articles

SQA Software and Tools

SQA Software and Tools In quality assurance it is always important to get all the help we could get In other industries developers could easily check the products manually and discard those that do not meet the standard The length and the width of the product are checked to maintain standardization
 

jQuery - Enabling the Pager Buttons

Learning jQuery Enabling the Pager Buttons To make these new buttons actually work we need to update the currentPage variable and then run our pagination routine At first blush it seems we should be able to do this by setting currentPage to page which is the current value of the iterator that create
 

Business Network Virtual Communication Tools

Business Network Virtual Communication Tools Since ages the Business community heavily relied on face to face communication for building Business relationships Face to face communications formed the basis for trust in a relationship An individual’ s appearance or the physical appearance of
 

What are Data Access Tools

Data access is the process of entering a database to store or retrieve data. Data Access Tools are end user oriented tools that allow users to build structured query language (SQL) queries by pointing and clicking on the list of table and fields in the data warehouse. Thorough computing history, t
 

Testing and Integration

Once the software is complete, it will go though rigorous testing before its actual integration.  In this article we will take a look at different types of software testing and also different types of integration. With the diversity of business setting and software development models, it al
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

SAP and Microsoft tools for Customer Service

World’s largest car dealer to use SAP and Microsoft tools for Customer Service Inchcape, the London-based largest car dealer in the world, is making itself much strong now by improving its customer services arising from major SAP and Microsoft implementations. The company has also vowed to
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Career Assessment Tools

For those not sure what type of career they are interested in pursuing, career assessment tools can provide help. There are assessments available at career centers that are designed to help people figure out a good career option. They explore your personality, skills, interests, and values, and can
 

Recording Test Script With WinRunner

How To Use a Wizard to Record a Test Script With WinRunner If you have a script that you want to convert with WinRunner, you can use the DataDriver Wizard to transform the script into a test that is driven by data. For instance, if you want your test script to include things such as checkpoints or v
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape