QTP Questions VB Script Syntax (50 Examples) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 Print Hello World Find whether given number is a odd number Print

odd numbers between given range of numbers Find the factorial of a given number Find the factors of a given number Print prime numbers between given range of numbers Swap 2 numbers with out a temporary variable Write a program to Perform specified Arithmetic Operation on two given numbers Find the length of a given string Reverse given string Find how many alpha characters present in a string. Find occurrences of a specific character in a string Replace space with tab in between the words of a string. Write a program to return ASCII value of a given character Write a program to return character corresponding to the given ASCII value Convert string to Upper Case Convert string to lower case Write a program to Replace a word in a string with another word Check whether the string is a POLYNDROM Verify whether given two strings are equal Print all values from an Array Sort Array elements Add two 3X3 matrices Multiply Two Matrices of size 2X2 Convert a String in to an array Convert a String in to an array using ‘I’ as delimiter Find number of words in string Write a program to reverse the words of a given string. Print the data as a Pascal triangle Join elements of an array as a string Trim a given string from both sides Write a program to insert 100values and to delete 50 values from an array Write a program to force the declaration of variables Write a program to raise an error and print the error number. Finding whether a variable is an Array Write a program to Convert value into a currency Write a program to Convert an expression to a date Display current date and Time Find difference between two dates. Add time interval to a date Print current day of the week Convert Date from Indian Format to US format

43 44 45 46 47 48 49 50 51 52 53 54 Find whether current month is a long month Find whether given year is a leap year Format Number to specified decimal places Write a program to Generate a Random Number Write a program to show difference between Fix and Int Write a program to find subtype of a variable Write a program to print the decimal part of a given number Write a Function to return a random number Write a Function to add and multiply two numbers Write a Sub Procedure to print “Hello World” Write a Sub Procedure to add and multiply two numbers Write a program to list the Timezone offset from GMT .

modify and delete disk quota Write a program to display all files containing “demo” in their name Write a program to print all lines in a file that ends with “world” Write a program to check whether string starts with “Error” Write a program to Replace all words that contains “demo” in a file with the word “infics” Write a program to check whether a string contains only alpha numerics Write a program to check whether a string is in email format Write a program to check whether given string is in date format Write a program to print all the lines ending with '$' Check whether middle three characters in a word contains alphanumeric Check whether a given line is an empty Write a program to Add elements to a dictionary Write a program to display items in a dictionary Write a program to check whether specified Key exists in a Dictionary Write a program to Store dictionary items in an array Write a program to delete Key Value pair in the dictionary Write a program to monitor operating system performance Write a program to monitor operating system objects Write a program to monitor web server performance Write a program to monitor browser service performance Write a program to list the PID and PPID of a process . Write a program to display files of a specific type Write a program to print the free space in a given drive Write a program to display all subfolders in a given folder Write a program to find whether a given folder is a special folder Write a program to remove all empty files in the folder Write a program to Copy contents of one folder to other folder Write a program to check whether a given path represents a file or a folder Write a program to compress a folder Write a program to rename a folder Write program to display all folders created on a specific date Write a Program to enable disk quotas Write a program to create.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 VB Script Advanced Programming (100 Examples) Write a program to read data from a text file Write a program to write data into a text file Write a program to print all lines that contains a word either “infics” or “solutions” Write a program to print the current foldername Write a program to print files in a given folder Write a program to print subfolders in a given folder Write a program to print all drives in the file system Write a program to print current drive name Print the last modified and creation date of a given file Print the size of the file and size on the disk.

Write a program to list services that can be stopped Write a program to start auto start services that have stopped Write a program to Invoke command prompt and execute dir command from the shell Write a program to schedule a task Write a program to list and delete scheduled tasks Write a program to add a local user account Write a program to disable and delete a local user account Write a program to list all user accounts in the local computer Write a program to display logged in user name Write a program to list cache memory information Write a program to list physical memory properties Write a program to list memory devices Write a program to find Hard Disk size Write a program to find RAM size Write a program to restart a computer Write a program to shutdown a computer Write a program to Execute Perl script from VB Script Find the systems present in the LAN Write a program to Print using remote printer Verify whether IE enhanced security is enabled for logged on user Write a program to add a website to a favourite menu Write a program to list IE LAN settings Write a program to list cache. connection and security zone settings Find the arguments passed to a Windows Script Host Write a program to Map a network drive Write a program to Print to the local printer Write a program to Print to remote printer Write a program to Print Computer name Write a program to Print free memory in the drive Write a program to Print memory and CPU utilized by a process Write a program to Find the ipaddress of a local system Write a program to find Network Drives Write a program to find the Full path name of a shortcut Write a program to Retrieve all the rows in a table Write a program to find the name of columns in a table Write a program to find number of rows in each column Write a program to connect and print data from oracle database Write a program to connect and print data from SQL Server database .43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 Write a program to create a registry key Write a program to list registry files Write a program to list registry value and types Write a program to delete registry key Write a program to Stop and Start alerter service Write a program to list services running and their statuses.

87 88 89 90 91 92 93 94 95 96 97 98 99 100 Write a program to retrieve specific field from the database table Write a program to check whether a column in the database is in ascending order Write a program to insert a new row into the database table Write a program to open the two record sets Write a program to Update the specific field in the database table Write a program to delete all records whose username starts with demo Write a program to sort the record set Write a program to find number of rows in a table Write a program to Write simple text to windows word Write a program to Write table to windows word Write a program to apply style to a table in word document Write a program to open and print a word document Write a program to send an email using outlook Write a program to print data present in all sheets of an excel files .

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 38 39 40 41 42 43 QTP Scripting (100 Examples) Write a program to enter data in login screen Write a program to find the x and y coordinates of a button Write a program to Read items in a list box Write a program to Read items on a desktop Write a program to Capture Desktop Screen shot Write a program to Read tab names from a tabbed window Write a program to Check whether scrollbars exists inside a editor Write a program to check whether edit box is enabled or writable Write a program to Check scroll bars in a web page Write a program to Check whether dialog is middle of the window Write a program to Check whether Window is middle of the screen Write a program to Check whether country contains all the states Write a program to Check whether edit box is focused Write a program to Check default selection in a list box Write a program to Capture webbutton image Write a program to List all links in the web page Write a program to Check whether given link exists Write a program to Find image width and Height Write a program to Print URL displayed in the address bar Write a program to Check whether webpage downloaded completely Write a program to Refresh a web page Write a program to Verify page title is displayed correctly Write a program to Verify whether page contains frames Write a program to Find page load time Write a program to Check given text is displayed on the web page Write a program to Find whether image contains tool tip Write a program to Invoke the Browser with specified URL Write a program to Import an excel file to a Data table Write a program to Read data from first parameter of Global sheet Write a program to Read data from all sheets and all parameters of the excel file Write a program to place data in a specific sheet in the excel file Write a program to Import data to data table from a database Write a program to Read and display data from CSV file Write a program to Find number of rows and columns in a web table Write a program to Display entire data in the web table Write a program to Display all images in the webpage Write a program to Check whether table contains headers Write a program to Find the background colour of a webobject Write a program to Print results in a HTML format Write a program to Select different radio buttons for different script iterations Write a program to Find the dialog Height whose window name is “<Date> Appointments” Write a program to Read all the items from a services window .

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 Write a program to Find screen resolution Write function to compare two bitmaps Write a program to Add and Remove Repositories to the action Write a program to Load Library files Write a program to Enable and Disable Recovery scenarios programmatically Write a program to Report Results status to Results file Write a program to Find the active window name Write a program to List out the windows that are open Write a program to Call reusable actions from different script Write your own standard checkpoint Write your own synchronization function Write a program to Check whether there is a memory leak in the process Write a program to Close all the dialogs open in a window Write a program to Read menu names Write a program to Read menu items Write a program to Check whether a check button is selected or not Write a program to Check whether we can select multiple items in the listbox Write a program to Check whether edit box allows exactly 15 characters Write a program to Check whether items in the page are aligned properly Write a program to Check whether data in the webtable is left aligned Write a program to Find which add-ins are loaded. Write a program to Check whether stock prices are updating an hourly basis Write a program to Retrieve Action Parameters Write a program to Disable active screen programmatically . Write a program to Find Font size Write a program to Check whether text is bold and underlined Write a program to Find the memory utilized by a process Write a program to Verify flash image Write a program to Check pointed link is having different back ground colour? Write a program to Check Marquee Write a program to Check whether selected tab is having different appearance? Write a program to Check whether a link contains image to its left side. Write a program to Find available add-ins in the tool Write a program to Change window title Write a program to Find whether specified window is there on the desktop Write a program to Check whether a window is in minimized or maximized Write a program to Check window is resizable Write a program to Check whether logo displayed is correct? Write a program to Read all items in a tree Write a program to Read all elements in the XML file Write a program to Read attributes of a particular element in the XML file Write a program to Modify attribute value Write a program to Add one more elements to XML file Write a program to Display complete contents of an XML file Write a program to Find font type.

89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 Write a program to Modify Mandatory and Assistive properties programmatically Write a program to Configure Run options programmatically Write a program to Define test results location through program Write a program to Disable Run settings Write a program to Read and Update data from user defined environmental variable Write a program to Configure maximum timeout value for web page to load Write a program to read and delete cookies Write a program to Verify whether status indicator is moving as the movie is playing Write a program to Clear the cache in the webpage Write a program to Check whether webpage is loaded from server or from cache Write a program to Configure web options programmatically Write a program to Instruct Quicktest to Capture Movie Segments of Each Error and Warning Write a program to Check whether new items can be added to a listbox Write a program to Check whether link s pointing to correct URL Write a program to invoke the application Write a program to Read parameters in the data table Write a program to List out the windows that are minimized Write a program to add environmental variables during run time Write a program to check whether tab order is left to right and top to bottom Write a program to find the maximum text length that can be entered in a edit box Write a program to verify min and max length constraints of text in an edit box Write a program to find the kind of data edit box accepts Write a program to add objects to object repository file Write a program to export object repository file to XML Write a program to check whether a column in the database table is a primary key Write a program to display constraints of a column in the database table .

Sign up to vote on this title
UsefulNot useful