Vbscript Assignments

10

Click here to load reader

Transcript of Vbscript Assignments

Page 1: Vbscript Assignments

1 Print Hello World2 Find whether given number is a odd number3 Print odd numbers between given range of numbers4 Find the factorial of a given number5 Find the factors of a given number6 Print prime numbers between given range of numbers7 Swap 2 numbers with out a temporary variable8 Write a program to Perform specified Arithmetic Operation on two given numbers9 Find the length of a given string10 Reverse given string11 Find how many alpha characters present in a string.12 Find occurrences of a specific character in a string13 Replace space with tab in between the words of a string.14 Write a program to return ASCII value of a given character15 Write a program to return character corresponding to the given ASCII value16 Convert string to Upper Case17 Convert string to lower case18 Write a program to Replace a word in a string with another word19 Check whether the string is a POLYNDROM20 Verify whether given two strings are equal21 Print all values from an Array22 Sort Array elements23 Add two 3X3 matrices24 Multiply Two Matrices of size 2X225 Convert a String in to an array26 Convert a String in to an array using ‘I’ as delimiter27 Find number of words in string28 Write a program to reverse the words of a given string.29 Print the data as a Pascal triangle30 Join elements of an array as a string31 Trim a given string from both sides32 Write a program to insert 100values and to delete 50 values from an array33 Write a program to force the declaration of variables34 Write a program to raise an error and print the error number. 35 Finding whether a variable is an Array36 Write a program to Convert value into a currency37 Write a program to Convert an expression to a date38 Display current date and Time39 Find difference between two dates.40 Add time interval to a date41 Print current day of the week42 Convert Date from Indian Format to US format43 Find whether current month is a long month44 Find whether given year is a leap year

Page 2: Vbscript Assignments

45 Format Number to specified decimal places46 Write a program to Generate a Random Number47 Write a program to show difference between Fix and Int 48 Write a program to find subtype of a variable49 Write a program to print the decimal part of a given number50 Write a Function to return a random number51 Write a Function to add and multiply two numbers52 Write a Sub Procedure to print “Hello World”53 Write a Sub Procedure to add and multiply two numbers54 Write a program to list the Timezone offset from GMTVB Script Advanced Programming (100 Examples)1 Write a program to read data from a text file2 Write a program to write data into a text file3 Write a program to print all lines that contains a word either “infics” or “solutions”4 Write a program to print the current foldername5 Write a program to print files in a given folder6 Write a program to print subfolders in a given folder7 Write a program to print all drives in the file system8 Write a program to print current drive name9 Print the last modified and creation date of a given file10 Print the size of the file and size on the disk.11 Write a program to display files of a specific type12 Write a program to print the free space in a given drive13 Write a program to display all subfolders in a given folder14 Write a program to find whether a given folder is a special folder15 Write a program to remove all empty files in the folder16 Write a program to Copy contents of one folder to other folder17 Write a program to check whether a given path represents a file or a folder18 Write a program to compress a folder19 Write a program to rename a folder20 Write program to display all folders created on a specific date21 Write a Program to enable disk quotas22 Write a program to create, modify and delete disk quota23 Write a program to display all files containing “demo” in their name24 Write a program to print all lines in a file that ends with “world”25 Write a program to check whether string starts with “Error”26 Write a program to Replace all words that contains “demo” in a file with the word “infics”27 Write a program to check whether a string contains only alpha numerics28 Write a program to check whether a string is in email format29 Write a program to check whether given string is in date format30 Write a program to print all the lines ending with '$'31 Check whether middle three characters in a word contains alphanumeric32 Check whether a given line is an empty33 Write a program to Add elements to a dictionary

Page 3: Vbscript Assignments

34 Write a program to display items in a dictionary35 Write a program to check whether specified Key exists in a Dictionary36 Write a program to Store dictionary items in an array37 Write a program to delete Key Value pair in the dictionary38 Write a program to monitor operating system performance39 Write a program to monitor operating system objects40 Write a program to monitor web server performance41 Write a program to monitor browser service performance42 Write a program to list the PID and PPID of a process43 Write a program to create a registry key44 Write a program to list registry files45 Write a program to list registry value and types46 Write a program to delete registry key47 Write a program to Stop and Start alerter service48 Write a program to list services running and their statuses.49 Write a program to list services that can be stopped50 Write a program to start auto start services that have stopped51 Write a program to Invoke command prompt and execute dir command from the shell52 Write a program to schedule a task53 Write a program to list and delete scheduled tasks54 Write a program to add a local user account55 Write a program to disable and delete a local user account56 Write a program to list all user accounts in the local computer57 Write a program to display logged in user name58 Write a program to list cache memory information59 Write a program to list physical memory properties60 Write a program to list memory devices61 Write a program to find Hard Disk size62 Write a program to find RAM size63 Write a program to restart a computer64 Write a program to shutdown a computer65 Write a program to Execute Perl script from VB Script66 Find the systems present in the LAN67 Write a program to Print using remote printer68 Verify whether IE enhanced security is enabled for logged on user69 Write a program to add a website to a favourite menu70 Write a program to list IE LAN settings71 Write a program to list cache, connection and security zone settings72 Find the arguments passed to a Windows Script Host73 Write a program to Map a network drive74 Write a program to Print to the local printer75 Write a program to Print to remote printer76 Write a program to Print Computer name77 Write a program to Print free memory in the drive

Page 4: Vbscript Assignments

78 Write a program to Print memory and CPU utilized by a process79 Write a program to Find the ipaddress of a local system80 Write a program to find Network Drives81 Write a program to find the Full path name of a shortcut82 Write a program to Retrieve all the rows in a table83 Write a program to find the name of columns in a table84 Write a program to find number of rows in each column85 Write a program to connect and print data from oracle database86 Write a program to connect and print data from SQL Server database87 Write a program to retrieve specific field from the database table88 Write a program to check whether a column in the database is in ascending order89 Write a program to insert a new row into the database table90 Write a program to open the two record sets91 Write a program to Update the specific field in the database table92 Write a program to delete all records whose username starts with demo93 Write a program to sort the record set94 Write a program to find number of rows in a table95 Write a program to Write simple text to windows word96 Write a program to Write table to windows word97 Write a program to apply style to a table in word document98 Write a program to open and print a word document99 Write a program to send an email using outlook

100 Write a program to print data present in all sheets of an excel files

QTP Scripting (100 Examples)1 Write a program to enter data in login screen2 Write a program to find the x and y coordinates of a button3 Write a program to Read items in a list box4 Write a program to Read items on a desktop5 Write a program to Capture Desktop Screen shot6 Write a program to Read tab names from a tabbed window7 Write a program to Check whether scrollbars exists inside a editor8 Write a program to check whether edit box is enabled or writable9 Write a program to Check scroll bars in a web page10 Write a program to Check whether dialog is middle of the window11 Write a program to Check whether Window is middle of the screen12 Write a program to Check whether country contains all the states13 Write a program to Check whether edit box is focused14 Write a program to Check default selection in a list box15 Write a program to Capture webbutton image16 Write a program to List all links in the web page17 Write a program to Check whether given link exists

Page 5: Vbscript Assignments

18 Write a program to Find image width and Height19 Write a program to Print URL displayed in the address bar20 Write a program to Check whether webpage downloaded completely21 Write a program to Refresh a web page22 Write a program to Verify page title is displayed correctly23 Write a program to Verify whether page contains frames24 Write a program to Find page load time25 Write a program to Check given text is displayed on the web page26 Write a program to Find whether image contains tool tip27 Write a program to Invoke the Browser with specified URL28 Write a program to Import an excel file to a Data table29 Write a program to Read data from first parameter of Global sheet30 Write a program to Read data from all sheets and all parameters of the excel file31 Write a program to place data in a specific sheet in the excel file32 Write a program to Import data to data table from a database33 Write a program to Read and display data from CSV file35 Write a program to Find number of rows and columns in a web table36 Write a program to Display entire data in the web table37 Write a program to Display all images in the webpage38 Write a program to Check whether table contains headers39 Write a program to Find the background colour of a webobject40 Write a program to Print results in a HTML format41 Write a program to Select different radio buttons for different script iterations42 Write a program to Find the dialog Height whose window name is “ Appointments”43 Write a program to Read all the items from a services window44 Write a program to Find screen resolution45 Write function to compare two bitmaps46 Write a program to Add and Remove Repositories to the action47 Write a program to Load Library files48 Write a program to Enable and Disable Recovery scenarios programmatically49 Write a program to Report Results status to Results file50 Write a program to Find the active window name51 Write a program to List out the windows that are open 52 Write a program to Call reusable actions from different script53 Write your own standard checkpoint54 Write your own synchronization function55 Write a program to Check whether there is a memory leak in the process56 Write a program to Close all the dialogs open in a window57 Write a program to Read menu names58 Write a program to Read menu items59 Write a program to Check whether a check button is selected or not60 Write a program to Check whether we can select multiple items in the listbox61 Write a program to Check whether edit box allows exactly 15 characters62 Write a program to Check whether items in the page are aligned properly

Page 6: Vbscript Assignments

63 Write a program to Check whether data in the webtable is left aligned64 Write a program to Find which add-ins are loaded.65 Write a program to Find available add-ins in the tool66 Write a program to Change window title67 Write a program to Find whether specified window is there on the desktop68 Write a program to Check whether a window is in minimized or maximized69 Write a program to Check window is resizable70 Write a program to Check whether logo displayed is correct?71 Write a program to Read all items in a tree72 Write a program to Read all elements in the XML file73 Write a program to Read attributes of a particular element in the XML file74 Write a program to Modify attribute value75 Write a program to Add one more elements to XML file76 Write a program to Display complete contents of an XML file77 Write a program to Find font type.78 Write a program to Find Font size79 Write a program to Check whether text is bold and underlined80 Write a program to Find the memory utilized by a process81 Write a program to Verify flash image82 Write a program to Check pointed link is having different back ground colour?83 Write a program to Check Marquee84 Write a program to Check whether selected tab is having different appearance?85 Write a program to Check whether a link contains image to its left side.86 Write a program to Check whether stock prices are updating an hourly basis87 Write a program to Retrieve Action Parameters88 Write a program to Disable active screen programmatically89 Write a program to Modify Mandatory and Assistive properties programmatically90 Write a program to Configure Run options programmatically91 Write a program to Define test results location through program92 Write a program to Disable Run settings93 Write a program to Read and Update data from user defined environmental variable94 Write a program to Configure maximum timeout value for web page to load95 Write a program to read and delete cookies96 Write a program to Verify whether status indicator is moving as the movie is playing97 Write a program to Clear the cache in the webpage98 Write a program to Check whether webpage is loaded from server or from cache99 Write a program to Configure web options programmatically100 Write a program to Instruct Quicktest to Capture Movie Segments of Each Error and Warning 101 Write a program to Check whether new items can be added to a listbox102 Write a program to Check whether link s pointing to correct URL103 Write a program to invoke the application104 Write a program to Read parameters in the data table105 Write a program to List out the windows that are minimized

Page 7: Vbscript Assignments

106 Write a program to add environmental variables during run time107 Write a program to check whether tab order is left to right and top to bottom108 Write a program to find the maximum text length that can be entered in a edit box109 Write a program to verify min and max length constraints of text in an edit box110 Write a program to find the kind of data edit box accepts111 Write a program to add objects to object repository file112 Write a program to export object repository file to XML113 Write a program to check whether a column in the database table is a primary key114 Write a program to display constraints of a column in the database table