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 639 of 654    Print  
Function for Key board entries
I would like to know how can i create a function for the Key board entries like the F1, F2, F3....., ALT+TAB, Shift+Tab, etc. and can use it as a Business or Scripted Component in QC?


  
Total Answers and Comments: 1 Last Update: June 06, 2008     Asked by: SravantiK 
  
 Sponsored Links



 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 06, 2008 00:44:50   #1  
akothuru Member Since: April 2008   Contribution: 13    

RE: Function for Key board entries
Using SendKeys method, user can perform keyboard operations like Alf+F4 , Ctrl, Backspace etc in QTP... and it is a VB Script code

'Create Shell object to access Sendkeys method
Set objShell = CreateObject("WScript.Shell")
objShell.SendKeys "aaa" 'Enters the string "aaa" using keyboard
objShell.SendKeys "{F5}"  'Press F5 button Refresh
objShell.SendKeys "%{F4}"  'Close the currently activated window/browser

Note:
% represents Alt
+ represents Shift
^ represents Ctrl

  • e and c are pressed, send the string argument "+(ec)".
  • e is pressed, followed by a lone c (with no SHIFT), send the string argument "+ec".


  •  
    Is this answer useful? Yes | No

     Related Questions

    Latest Answer : Actually, there will be 3 types functions : --> Local script (Function definition and function call will be in script only ) --> Built functions (Predefined functions , only we have to call these functions) --> Library functions ...
    Read Answers (9) | Asked by : kumar

    These are the new features which are available in QTP8.2 and which are not present in 6.5 version.Keyword View: Lets you easily build and maintain tests without writingVBScripts.Auto-Documentation: Provides 
    Latest Answer : Really great help,Thanks ...
    Read Answers (2) | Asked by : James

    How do u ignore exceptions raised by a procedure or function within a package.Ex: Package a { Proc1; Func1; ---- raised an exception Proc2; Proc3; }Note : Even if Func1 raises an exception proc2 and proc3 must be excecuted.
    Read Answers (1) | Asked by : Uday Sharma

    Give an example of a regular expression,user-defined function and built-in-function?how to make a user-defined function reusable?
    Read Answers (2) | Asked by : Mann

    Latest Answer : Built-in-functions:dim myleftnamemyleftname = "Vinothkumar"msgbox left(myleftname,6)External Functions ;This requires the user to add the library in the Test >> settings >> Resources and call this libex: mylib.vbsfunction hi()dim myleftnamemyleftname ...
    Read Answers (1) | Asked by : Mann

    How to add a failure from a VBscript function to the results. how can I implement the functionality of checkpoint functionality from by VBScript. For Ex: I want to record a failure if some calculations evaluate to false.
    Read Answers (2) | Asked by : Ashok

    How to add my own function in QTP.when I run my function in QTP then its throw an error "Error in library file. Your function library may not be valid.Do you want to continue running the test?"Now how to add library file & which file. DO u have any example of function how to write in QTP
    Read Answers (2) | Asked by : rajivkumarnandvani

    Latest Answer : hi,You have button called SetAsDefault in Test > Settings > Resources. Create the shared repository and click on the button when ever you open new script it will load shared repository automatically. If you want to load dynamically means ...
    Read Answers (3) | Asked by : Tulasiram

    Latest Answer : 1. Recovery Scenario2. Recall? You can call a function from anywhere by: Call FunctionName() ...
    Read Answers (2) | Asked by : raghu.ch

    How can we return values from userdefined function? anybody provide code with small example its great for me.
    Read Answers (2) | Asked by : Magadala


     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
     

    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
     

    C++ Pure Virtual Function and Base Class

    C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
     

    C++ Function Passing Types

    C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value  and  passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
     

    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
     

    What is DECODE function used for?

    DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
     

    printf() Function Return Value

    What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf("%d",printf("%d %d %d", a,a,a)); } In this above program the inner printf i
     

    How is the main() function declared?

    The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
     

    How does the function call within function get evaluated?

    Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
     

    What happens when a variable is not initialized in main function?

    When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
     

    Sponsored Links

     
    Sponsored Links

     




    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