The document provides examples of working with file system objects in Visual Basic Scripting Edition (VBScript) to perform various operations like creating, reading, writing, deleting folders and files. Some key examples include creating a folder, copying a folder, reading and writing to text files, comparing text files, counting word occurrences in a file, and capturing data to export to an external text file. The examples demonstrate how to use the FileSystemObject to manipulate files and folders programmatically in VBScript.
The document discusses various methods for working with files, folders, drives, flat files, word documents, and excel sheets using Visual Basic Script. Some key methods include creating, deleting, copying, and checking folders; getting drive information; reading from and writing to flat files; creating, saving and comparing word documents and excel files. The document provides code examples for performing each of these file operations.
Introduction to the new official C# Driver developed by 10genMongoDB
The document provides an introduction and overview of the MongoDB C# driver:
- It highlights that the driver is fully featured, high performance, and rapidly tracks new releases of MongoDB.
- It outlines the driver's release timeline and how to download, add references to, and use namespaces in the driver.
- It describes some key classes in the driver like BsonDocument, MongoServer, MongoDatabase, and MongoCollection.
This document provides an introduction to using MongoDB with C# developers. It discusses how to connect to a MongoDB database from a C# application, perform basic CRUD operations on documents using the C# driver, and more advanced features like aggregation, geospatial queries, and gridFS for large files. The document includes code examples for connecting to a database, inserting, finding, updating, and deleting documents, as well as using LINQ queries and the aggregation framework. Resources for learning more about the MongoDB C# driver are also provided.
The document provides an overview of using MongoDB with C# developers. It discusses key MongoDB concepts like document databases and BSON, and how to connect and perform CRUD operations with the C# driver. It also covers more advanced topics like geospatial queries, MapReduce, and GridFS for large files. Resources are provided for further learning about MongoDB and the C# driver.
Sequelize is a promise-based ORM for Node.js that allows for modeling of database tables, querying, and synchronization between models and tables. It supports PostgreSQL, MySQL, MariaDB, SQLite, and MSSQL. Sequelize provides advantages like saving time and effort for developers by handling basic tasks and allowing a focus on business logic. Models can be defined and queried, validated, associated with other models, and synchronized with database tables. Raw SQL queries can also be executed through Sequelize.
This document discusses several key questions to consider when creating an offline application, including what functionality should be available offline, how to store application data locally, and how to handle synchronization between offline and online data. It provides examples of different storage options for offline data, such as the Application Cache, Service Workers Cache API, web storage, web SQL, file system API, and IndexedDB. It also discusses approaches for resolving conflicts when synchronizing offline and online data, such as using timestamps or optimistic/pessimistic locking strategies. The document is an informative resource for developers building offline-capable web applications.
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
This intermediate-level talk will teach you techniques using the popular NoSQL database MongoDB and the Python library Ming to write maintainable, high-performance, and scalable applications. We will cover everything you need to become an effective Ming/MongoDB developer from basic PyMongo queries to high-level object-document mapping setups in Ming.
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v Arian Gutierrez
This script collects system information from a Windows computer, including process list, computer details, recently opened files, and browsing history. It then sends an email with this information attached to a specified email address, using SMTP authentication over SSL to send through a Hotmail account. The script saves itself in the Temp folder to persist across reboots and collects information on startup.
The document discusses various methods for working with files, folders, drives, flat files, word documents, and excel sheets using Visual Basic Script. Some key methods include creating, deleting, copying, and checking folders; getting drive information; reading from and writing to flat files; creating, saving and comparing word documents and excel files. The document provides code examples for performing each of these file operations.
Introduction to the new official C# Driver developed by 10genMongoDB
The document provides an introduction and overview of the MongoDB C# driver:
- It highlights that the driver is fully featured, high performance, and rapidly tracks new releases of MongoDB.
- It outlines the driver's release timeline and how to download, add references to, and use namespaces in the driver.
- It describes some key classes in the driver like BsonDocument, MongoServer, MongoDatabase, and MongoCollection.
This document provides an introduction to using MongoDB with C# developers. It discusses how to connect to a MongoDB database from a C# application, perform basic CRUD operations on documents using the C# driver, and more advanced features like aggregation, geospatial queries, and gridFS for large files. The document includes code examples for connecting to a database, inserting, finding, updating, and deleting documents, as well as using LINQ queries and the aggregation framework. Resources for learning more about the MongoDB C# driver are also provided.
The document provides an overview of using MongoDB with C# developers. It discusses key MongoDB concepts like document databases and BSON, and how to connect and perform CRUD operations with the C# driver. It also covers more advanced topics like geospatial queries, MapReduce, and GridFS for large files. Resources are provided for further learning about MongoDB and the C# driver.
Sequelize is a promise-based ORM for Node.js that allows for modeling of database tables, querying, and synchronization between models and tables. It supports PostgreSQL, MySQL, MariaDB, SQLite, and MSSQL. Sequelize provides advantages like saving time and effort for developers by handling basic tasks and allowing a focus on business logic. Models can be defined and queried, validated, associated with other models, and synchronized with database tables. Raw SQL queries can also be executed through Sequelize.
This document discusses several key questions to consider when creating an offline application, including what functionality should be available offline, how to store application data locally, and how to handle synchronization between offline and online data. It provides examples of different storage options for offline data, such as the Application Cache, Service Workers Cache API, web storage, web SQL, file system API, and IndexedDB. It also discusses approaches for resolving conflicts when synchronizing offline and online data, such as using timestamps or optimistic/pessimistic locking strategies. The document is an informative resource for developers building offline-capable web applications.
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
This intermediate-level talk will teach you techniques using the popular NoSQL database MongoDB and the Python library Ming to write maintainable, high-performance, and scalable applications. We will cover everything you need to become an effective Ming/MongoDB developer from basic PyMongo queries to high-level object-document mapping setups in Ming.
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v Arian Gutierrez
This script collects system information from a Windows computer, including process list, computer details, recently opened files, and browsing history. It then sends an email with this information attached to a specified email address, using SMTP authentication over SSL to send through a Hotmail account. The script saves itself in the Temp folder to persist across reboots and collects information on startup.
The document provides an overview of jQuery, including:
1. It describes the steps in developing a web page using HTML, CSS, DOM trees, and JavaScript.
2. It then explains why jQuery is useful, such as for hiding/showing elements, dynamic loading of content, and interactive effects.
3. It summarizes key jQuery concepts like selectors, events, modifying attributes and styles, animations, manipulating HTML, and making AJAX requests.
The document discusses the history and features of web storage technologies including cookies, Flash storage, localStorage, sessionStorage, WebSQL, and IndexedDB. It provides examples of how to open a database connection, create tables, add and retrieve records using WebSQL and IndexedDB.
Creating, Updating and Deleting Document in MongoDBWildan Maulana
This document discusses various methods for creating, updating, and deleting documents in MongoDB collections, including inserting documents, batch inserts, removing documents, updating documents using modifiers like $set and $inc, and choosing appropriate write speeds and safety levels. Key points covered include using batch inserts to speed up multiple document inserts, removing entire collections being faster than removing individual documents, and partial document updates being done efficiently using atomic update modifiers.
Hidden Treasures of the Python Standard Librarydoughellmann
The standard library contains many hidden gems that are not widely used, either because they are not publicized enough or because they are deep in a module that programmers haven't had cause to study or use. This presentation covers a few selected topics of this nature in about 25 minutes (leaving time for a couple of questions). Demonstration code is included for every item.
This document discusses JavaScript inheritance using prototypes. It explains that objects inherit from other objects through their internal __proto__ property. Constructors set an object's __proto__ to reference the constructor's prototype. Methods can be added to the prototype and all objects will inherit those methods. The document also covers how to implement inheritance between constructors like Employee inheriting from Person without calling the parent constructor.
The document discusses various methods for reading and finding documents in MongoDB collections, including find(), findOne(), and querying embedded/nested documents. Find() and findOne() allow specifying query filters to match documents, as well as projections to select which fields to return. FindOne() returns a single matching document while find() returns a cursor to all matching documents. Queries can match on fields in embedded documents to return parent documents where the embedded document matches the query. Projections allow including or excluding fields in the returned result set.
Webinar: Simplifying Persistence for Java and MongoDBMongoDB
Jeff Yemin will host a webinar covering the design and major features of Morphia, an Object Document Mapper (ODM) for Java and MongoDB. This webinar will start with a short introduction to MongoDB and the various options for building MongoDB applications on the JVM before taking a deep dive into Morphia. Morphia will be presented as an extended example format that demonstrates, for each feature, the domain model, a test driver, and the results as they appear in MongoDB.
The document discusses several methods for creating, saving, deleting, and viewing objects stored on Parse, as well as creating relationships between objects. It provides code examples for saving a new object with the save and saveInBackground methods, deleting an object with delete and deleteInBackground, and creating a one-to-many relationship between a Group and Person objects by adding each to the other's relation. The document also briefly mentions Parse login, signup, and query table view controller classes, and loading remote images from Parse files.
The document discusses jQuery, an open-source JavaScript library that simplifies HTML document traversal and manipulation, event handling, animation, and Ajax interactions for rapid web development. It provides an overview of core jQuery concepts like selectors, events, effects, AJAX functionality, and compares it to other JavaScript frameworks. Thousands of major websites use jQuery due to its ability to write less code and do more with JavaScript and HTML.
MySQL Without the SQL - Oh My! -> MySQL Document Store -- Confoo.CA 2019Dave Stokes
MySQL an be used as a NoSQL JSON Document Store as well as its well known ability as a SQL Relational Data Base. This presentation covers why you would want to use NoSQL and JSON and how to combine it what the relational data you already have
The document discusses MongoDB, a non-relational database that uses documents with a flexible schema rather than tables, and is well-suited for applications that need to store data in complex, nested structures. It provides an overview of key MongoDB concepts like collections, queries, indexing, updating documents, and aggregation capabilities. Examples are given of how MongoDB can be used for applications involving user profiles, blogs, and logging.
Talk was presented at PGConfUS on April 20th, 2016.
___________
With features like foreign data wrappers, Postgres makes it easy for you to integrate rich data stores into your application architectures. Yet sometimes you only have a few rich data structures to deal with, or can’t afford the time and resource cost of running a NoSQL cluster alongside Postgres. Happily Postgres natively supports several document data formats, giving you the best of both worlds in one database. You can keep document oriented data solely within Postgres, or write a foreign table schema that’s naturally compatible with your document database.
At this talk you’ll learn how to access document data stored in Postgres, and write Ruby code to make use of the data with your favorite ORM. We’ll survey the various document stores which are natively supported in Postgres. You’ll learn what are the pros and cons of each data type, and come away understanding which use cases are best suited to each document store.
MongoDB is a scalable, high-performance, open-source document database that provides dynamic queries and indexing. It aims to provide the power of relational databases with the scalability and flexibility of non-relational databases. Key features include ease of use, scaling capabilities, dynamic queries similar to SQL, and speed comparable to key-value stores while supporting rich querying like relational databases.
Asp.net create delete directory folder in c# vb.netrelekarsushant
The document describes how to create and delete directories (folders) in ASP.NET using C# and VB.NET. It includes code samples for creating a directory when a user enters a name and clicks a button, deleting a directory when a user enters a name and clicks another button, and removing all directories and subdirectories recursively. The code utilizes the System.IO namespace and methods like Directory.CreateDirectory(), Directory.Exists(), Directory.Delete(), and GetFiles() to manage directories and files.
Slide de ma présentation au Voxxed Days Luxembourg 2017.
http://cfp-voxxed-lux.yajug.org/2017/talk/KMC-5325/Documentation_as_code:_controler_la_qualite_!
"Document as code" consiste à utiliser toutes les bonnes pratiques que nous utilisons pour notre source code et de les appliquer à la documentation. Les points clés sont :
* Utiliser un outil de gestion des sources (git) et de préférence le même que pour les sources.
* Un format de texte simple (pas de XML) comme AsciiDoc.
* Mettre en place des outils d'intégration continu et déploiement continu
Lorsque cette bonne pratique est en place, se pose une seconde catégorie de problème. Comment garantir la qualité :
* Faciliter la barrière à l’entrée en proposant un lien pour éditer la documentation sur chaque page et pour soumettre une pull request.
* Test systématique des exemples de code
* Respect des conventions de documentation
* Métriques et dashboard pour garantir la qualité
* Partage de bonnes pratiques/revue de documentation.
Cette présentation est un retour d’expérience et donne quelques bonnes pratiques de documentation. C'est un aperçu de ce qui peut être mis en place pour s’assurer de la qualité de la doc.
- Zhou Lizui is the founder and CEO of Sleepnova Inc. and a technical advisor for KKBOX on Android and cloud technologies.
- His interests include agile development, scalable architectures, and how information technology can benefit society.
- He has spoken at conferences on server-side JavaScript and NoSQL databases. One of his projects handled over 22 million requests in 4 hours for an election reporting system.
- RingoJS allows developing on the JVM with JavaScript's flexibility while accessing Java libraries, and offers alternatives to Node.js for server-side development.
Indexing in MongoDB works similarly to indexing in relational databases. An index is a data structure that can make certain queries more efficient by maintaining a sorted order of documents. Indexes are created using the ensureIndex() method and take up additional space and slow down writes. The explain() method is used to determine whether a query is using an index.
An idea of how to make JavaScript testable, presented at Stir Trek 2011. The world of JavaScript frameworks has changed greatly since then, but I still agree with the concepts.
The document discusses different categories of people - performers who achieve astounding results, followers who admire the performers, and those who envy the performers. It notes that the envious often think performers don't deserve success or that envious people could perform as well if they tried. The post argues this is a "moment of truth" where people must raise their standards and efforts to improve or change their approach if they want different results in the future. How people respond to these moments will impact their future success or lack thereof.
The document provides an overview of jQuery, including:
1. It describes the steps in developing a web page using HTML, CSS, DOM trees, and JavaScript.
2. It then explains why jQuery is useful, such as for hiding/showing elements, dynamic loading of content, and interactive effects.
3. It summarizes key jQuery concepts like selectors, events, modifying attributes and styles, animations, manipulating HTML, and making AJAX requests.
The document discusses the history and features of web storage technologies including cookies, Flash storage, localStorage, sessionStorage, WebSQL, and IndexedDB. It provides examples of how to open a database connection, create tables, add and retrieve records using WebSQL and IndexedDB.
Creating, Updating and Deleting Document in MongoDBWildan Maulana
This document discusses various methods for creating, updating, and deleting documents in MongoDB collections, including inserting documents, batch inserts, removing documents, updating documents using modifiers like $set and $inc, and choosing appropriate write speeds and safety levels. Key points covered include using batch inserts to speed up multiple document inserts, removing entire collections being faster than removing individual documents, and partial document updates being done efficiently using atomic update modifiers.
Hidden Treasures of the Python Standard Librarydoughellmann
The standard library contains many hidden gems that are not widely used, either because they are not publicized enough or because they are deep in a module that programmers haven't had cause to study or use. This presentation covers a few selected topics of this nature in about 25 minutes (leaving time for a couple of questions). Demonstration code is included for every item.
This document discusses JavaScript inheritance using prototypes. It explains that objects inherit from other objects through their internal __proto__ property. Constructors set an object's __proto__ to reference the constructor's prototype. Methods can be added to the prototype and all objects will inherit those methods. The document also covers how to implement inheritance between constructors like Employee inheriting from Person without calling the parent constructor.
The document discusses various methods for reading and finding documents in MongoDB collections, including find(), findOne(), and querying embedded/nested documents. Find() and findOne() allow specifying query filters to match documents, as well as projections to select which fields to return. FindOne() returns a single matching document while find() returns a cursor to all matching documents. Queries can match on fields in embedded documents to return parent documents where the embedded document matches the query. Projections allow including or excluding fields in the returned result set.
Webinar: Simplifying Persistence for Java and MongoDBMongoDB
Jeff Yemin will host a webinar covering the design and major features of Morphia, an Object Document Mapper (ODM) for Java and MongoDB. This webinar will start with a short introduction to MongoDB and the various options for building MongoDB applications on the JVM before taking a deep dive into Morphia. Morphia will be presented as an extended example format that demonstrates, for each feature, the domain model, a test driver, and the results as they appear in MongoDB.
The document discusses several methods for creating, saving, deleting, and viewing objects stored on Parse, as well as creating relationships between objects. It provides code examples for saving a new object with the save and saveInBackground methods, deleting an object with delete and deleteInBackground, and creating a one-to-many relationship between a Group and Person objects by adding each to the other's relation. The document also briefly mentions Parse login, signup, and query table view controller classes, and loading remote images from Parse files.
The document discusses jQuery, an open-source JavaScript library that simplifies HTML document traversal and manipulation, event handling, animation, and Ajax interactions for rapid web development. It provides an overview of core jQuery concepts like selectors, events, effects, AJAX functionality, and compares it to other JavaScript frameworks. Thousands of major websites use jQuery due to its ability to write less code and do more with JavaScript and HTML.
MySQL Without the SQL - Oh My! -> MySQL Document Store -- Confoo.CA 2019Dave Stokes
MySQL an be used as a NoSQL JSON Document Store as well as its well known ability as a SQL Relational Data Base. This presentation covers why you would want to use NoSQL and JSON and how to combine it what the relational data you already have
The document discusses MongoDB, a non-relational database that uses documents with a flexible schema rather than tables, and is well-suited for applications that need to store data in complex, nested structures. It provides an overview of key MongoDB concepts like collections, queries, indexing, updating documents, and aggregation capabilities. Examples are given of how MongoDB can be used for applications involving user profiles, blogs, and logging.
Talk was presented at PGConfUS on April 20th, 2016.
___________
With features like foreign data wrappers, Postgres makes it easy for you to integrate rich data stores into your application architectures. Yet sometimes you only have a few rich data structures to deal with, or can’t afford the time and resource cost of running a NoSQL cluster alongside Postgres. Happily Postgres natively supports several document data formats, giving you the best of both worlds in one database. You can keep document oriented data solely within Postgres, or write a foreign table schema that’s naturally compatible with your document database.
At this talk you’ll learn how to access document data stored in Postgres, and write Ruby code to make use of the data with your favorite ORM. We’ll survey the various document stores which are natively supported in Postgres. You’ll learn what are the pros and cons of each data type, and come away understanding which use cases are best suited to each document store.
MongoDB is a scalable, high-performance, open-source document database that provides dynamic queries and indexing. It aims to provide the power of relational databases with the scalability and flexibility of non-relational databases. Key features include ease of use, scaling capabilities, dynamic queries similar to SQL, and speed comparable to key-value stores while supporting rich querying like relational databases.
Asp.net create delete directory folder in c# vb.netrelekarsushant
The document describes how to create and delete directories (folders) in ASP.NET using C# and VB.NET. It includes code samples for creating a directory when a user enters a name and clicks a button, deleting a directory when a user enters a name and clicks another button, and removing all directories and subdirectories recursively. The code utilizes the System.IO namespace and methods like Directory.CreateDirectory(), Directory.Exists(), Directory.Delete(), and GetFiles() to manage directories and files.
Slide de ma présentation au Voxxed Days Luxembourg 2017.
http://cfp-voxxed-lux.yajug.org/2017/talk/KMC-5325/Documentation_as_code:_controler_la_qualite_!
"Document as code" consiste à utiliser toutes les bonnes pratiques que nous utilisons pour notre source code et de les appliquer à la documentation. Les points clés sont :
* Utiliser un outil de gestion des sources (git) et de préférence le même que pour les sources.
* Un format de texte simple (pas de XML) comme AsciiDoc.
* Mettre en place des outils d'intégration continu et déploiement continu
Lorsque cette bonne pratique est en place, se pose une seconde catégorie de problème. Comment garantir la qualité :
* Faciliter la barrière à l’entrée en proposant un lien pour éditer la documentation sur chaque page et pour soumettre une pull request.
* Test systématique des exemples de code
* Respect des conventions de documentation
* Métriques et dashboard pour garantir la qualité
* Partage de bonnes pratiques/revue de documentation.
Cette présentation est un retour d’expérience et donne quelques bonnes pratiques de documentation. C'est un aperçu de ce qui peut être mis en place pour s’assurer de la qualité de la doc.
- Zhou Lizui is the founder and CEO of Sleepnova Inc. and a technical advisor for KKBOX on Android and cloud technologies.
- His interests include agile development, scalable architectures, and how information technology can benefit society.
- He has spoken at conferences on server-side JavaScript and NoSQL databases. One of his projects handled over 22 million requests in 4 hours for an election reporting system.
- RingoJS allows developing on the JVM with JavaScript's flexibility while accessing Java libraries, and offers alternatives to Node.js for server-side development.
Indexing in MongoDB works similarly to indexing in relational databases. An index is a data structure that can make certain queries more efficient by maintaining a sorted order of documents. Indexes are created using the ensureIndex() method and take up additional space and slow down writes. The explain() method is used to determine whether a query is using an index.
An idea of how to make JavaScript testable, presented at Stir Trek 2011. The world of JavaScript frameworks has changed greatly since then, but I still agree with the concepts.
The document discusses different categories of people - performers who achieve astounding results, followers who admire the performers, and those who envy the performers. It notes that the envious often think performers don't deserve success or that envious people could perform as well if they tried. The post argues this is a "moment of truth" where people must raise their standards and efforts to improve or change their approach if they want different results in the future. How people respond to these moments will impact their future success or lack thereof.
- The document discusses how to effectively pitch a business to investors. It defines a pitch and explains that the investor is the buyer and entrepreneur is the seller.
- When pitching, the entrepreneur needs to show the investor that there is money to be made by investing in the business. The pitch should focus on who the customers are, how much they will pay and why, how many potential customers there are, and how the entrepreneur plans to reach and sell to customers.
- The document provides examples of effective starting points for a pitch, such as highlighting existing customers, revenues, and the founding team's past successes in building and selling other businesses. The key is to grab the investor's attention quickly by showing what most exc
Karl Marx divided society into classes based on relationships to factors of production like land, capital, and labor. He believed class struggle would occur in two phases, with the bourgeoisie first overthrowing the aristocracy through industrialization, then the proletariat gaining political consciousness to overthrow the bourgeoisie and share wealth. However, Marxist revolution did not happen as predicted in developed nations with large working classes, instead occurring earlier in backward Russia led by the Bolsheviks who took power through a coup d'etat rather than wait for world revolution.
The researcher conducted a questionnaire of 60 cinema viewers to determine who is most likely to go to cinemas. The results showed that teenagers between 12-19 years old are most likely to go, followed by those between 20-28 years old. Females were more likely than males to attend. Horror films were the most popular genre. Most people attend with friends. Based on this, the researcher concluded their target market should be teenagers, with a focus on attracting both females and males through crime/gangster films, which were popular with both genders.
This document is a year 7 extra-curricular passport for the autumn term of 2014. It includes the student's name, tutor group, and the school motto of "Attend. Belong. Succeed.". The passport tracks the student's participation in extra-curricular activities during the first half of the autumn term.
The general philosophy of XDT when it comes to Geothermal Exploration. Using passive seismic waves and innovative seismic software to explore the subsurface.
This document shows the step-by-step work of solving the equation 12x^2 + 23x + 5 = 60. It factors the left side of the equation into (3x+5)(4x+1) and then sets that expression equal to the right side of the equation to solve for x.
Este manual fornece orientações práticas e teóricas para coaches de aprendizagem. Inclui atividades para estabelecer relações com os coachees, como quebra-gelos, e um guia passo-a-passo para sessões de coaching usando o modelo GROW. Também discute conceitos-chave como escuta ativa, feedback e auto-reflexão.
Computer’s evolution By Bobby King and Michael McWilliamsLostHunter
The document traces the evolution of computers from early machines like the Z1 that took up an entire room to modern portable devices that fit in pockets. It describes advances in size, input/output methods, programming languages, memory technology, and processing power over several generations of computers. Key developments included the introduction of integrated circuits, graphical user interfaces like Macintosh, and defeat of a human by the computer Deep Blue at chess. The timeline shows how materials, components, and capabilities have progressed from vacuum tubes to modern semiconductors.
I. Mempertahankan prinsip-prinsip Perlembagaan termasuk kedudukan Islam, agama-agama lain, bahasa Melayu, dan hak-hak istimewa kaum tertentu.
II. Memulihkan kewibawaan sistem kehakiman dan memastikan pilihanraya yang bersih dan adil.
III. Memacu ekonomi berprestasi tinggi dengan memberikan peluang pendidikan dan latihan berteraskan kemahiran.
QTP Excel Scripting Examples;
'Objects in Excel Object Model
a) Excel Application - Excel Application Object
b Excel Workbook / File - Workbook Object
c) Excel Worksheet / sheet - Worksheet
Important Operations on Excel files for Test Automation Using QuickTest Professional (QTP)
a) Create Excel Files
b) Open Excel Files
c) Copy Excel Files
d) Delete Excel Files
e) Move Excel Files
f) Read Data
e) Read Data for Data driven Testing
f) Write Data
g) Write Test Result
h) Comparing data (One to one)
i) Comparing data (One to Many)
j) Comparing data (Many to one)
k) Comparing data (Many to Many Exact)
l) Comparing data (Many to Many Textual)
m) Searching for strings
This document contains VBScript code to format existing Excel worksheets by standardizing column widths, fonts, and adding header and footer text before saving copies of the formatted sheets in a separate folder. The code opens Excel workbooks with a .xls extension, formats the worksheets within them based on criteria like bolding column headers and adjusting row heights, and saves copies of the formatted sheets with standardized filenames before closing and quitting Excel.
This document provides an overview of scripting with VBScript, including the anatomy of a VBScript, error handling, reading from and writing to files, reading command line results, querying WMI and Active Directory, and building GUIs with HTA. It discusses variables, constants, objects, functions, and subroutines as the main elements of a VBScript. It also provides examples of reading from and writing to files, executing commands and reading the output, and querying WMI classes. Finally, it mentions tools like Microsoft Scriptomatic and WMIGen that can help generate VBScript code.
Parameterization is nothing but giving multiple inputuanna
The document discusses different ways to parameterize test data in automation scripts, including inputting data from external files, using a datatable, looping, and interactive submission. It provides code examples of creating a FileSystemObject to work with files and folders, and using methods like CreateTextFile, CopyFile, DeleteFile, CreateFolder, and others.
The document contains source code and design documents for an inventory program. It includes use case diagrams, activity diagrams, collaboration diagrams, and component diagrams. It details the design of screens in VB6.0 and provides source code for connecting to a database, querying tables, inserting records, and updating stock quantities after purchases or sales. Screen designs and additional source code are presented for purchase and sales modules that also update the stock details after transactions.
Descriptive programming allows testers to directly enter object information into test scripts without using an object repository. There are two main types: static programming, where object information is directly provided in the script using properties and values, and dynamic programming, where description objects are created and used in the script. Descriptive programming is useful when objects are dynamic, the object repository is large, the application is not ready for recording, or modifications are needed but the repository is read-only. It offers benefits like faster execution, portability, easier maintenance, and the ability to start testing without the full application.
This document provides quick guides and code snippets for common JavaScript tasks when using Test Complete, such as creating objects and classes, reading and writing files, iterating through arrays, and connecting to databases. It includes examples of how to use try/catch blocks, switch statements, and extend built-in prototypes. Methods are demonstrated for working with strings, files, XML documents, SQL connections, and generating XML from objects.
N this article first we will create a table in a my sql database and then we ...Mark Daday
This document discusses saving an image to a MySQL database from a Windows Forms application. It describes creating a MEDIUMBLOB column in a database table to store images, selecting an image file using an open file dialog, reading the image into a byte array, and inserting the image bytes along with other data into the database table using a parameterized MySQL query.
The document discusses input/output streams in Java. It covers:
- Different types of data storage including transient RAM and persistent storage like disks.
- I/O sources and destinations like consoles, disks, networks etc. and how streams represent sequential bytes to abstract I/O details.
- Common Java I/O stream classes like FileReader, FileWriter, InputStream and OutputStream for reading/writing text and binary data from files.
- Using File class to represent files and directories with methods to check attributes, read content and manipulate files.
The document discusses file input/output (I/O) in Java, including how to declare a File object, create and delete files, read from and write to files using FileReader, BufferedReader, FileWriter, and BufferedWriter. Key aspects covered include declaring a File object to represent a file, using try-catch blocks to handle exceptions during file operations, reading lines of text from a file using BufferedReader.readLine(), and writing strings to a file using BufferedWriter.write() and BufferedWriter.newLine().
This document provides steps to create a zip file containing multiple files, including images and documents, using Java. It creates a ZipOutputStream and adds each file to the zip file by writing the file contents from a FileInputStream to the ZipOutputStream. It then examines the created zip file and shows it contains the expected files. The document also demonstrates how to create an uncompressed zip file and extract files from a zip file using the Java zip utilities.
This document discusses file handling in Java. It covers creating File objects to represent files and directories, and using streams for low-level and high-level file input and output of primitive data types, text, and objects. Methods like exists(), list(), isFile() are used to check files. The FileChooser class provides a GUI to select files. Streams like FileOutputStream, FileInputStream, PrintWriter, Scanner facilitate reading and writing files. Object streams allow writing and reading objects to files.
The document opens an Excel workbook and worksheet to retrieve login credentials. It then launches a browser to the Gmail login page, inputs the credentials from the Excel cells into the login fields, and attempts to log in. The script checks if the inbox page is displayed within 5 seconds to determine if login was successful or unsuccessful, and writes the result back to the Excel worksheet. It repeats this process to test multiple login credential rows from the worksheet.
This document discusses saving data using the Codable protocol to encode and decode model objects and save them to files in the app's Documents directory. It shows how to encode and decode a Note object using a PropertyListEncoder and PropertyListDecoder. It also demonstrates encoding and decoding an array of Note objects to save multiple items at once. The key steps are to implement Codable on model objects, perform the encoding/decoding in a model controller, and archive the data during app life cycle events like entering the background. The goal of the lesson is to persist data between app launches using Codable and storing files in the Documents directory.
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)Takayuki Shimizukawa
Takayuki Shimizukawa discusses how to generate documentation from Python source code using Sphinx. He introduces Sphinx and its extensions for automating documentation generation from docstrings. He demonstrates setting up a Sphinx project and configuring extensions like autodoc, autosummary, and doctest to generate API documentation and test code examples. The presentation emphasizes best practices for writing informative docstrings and code examples to fully document modules and functions.
Sphinx autodoc - automated api documentation - PyCon.MY 2015Takayuki Shimizukawa
Takayuki Shimizukawa presented an introduction to using Sphinx and docstrings to generate documentation from Python source code. Key points included setting up Sphinx with the autodoc, autosummary, and doctest extensions to automatically generate API documentation and test code examples from docstrings. Writing informative docstrings with parameter and return type information as well as code examples allows Sphinx to generate detailed, easy to understand documentation from Python modules, functions and methods.
The Ring programming language version 1.2 book - Part 5 of 84Mahmoud Samir Fayed
Ring 1.2 includes many new features and improvements, including:
1. New functions like PtrCmp() for comparing C pointers and RingVM_FunctionsList() to return a list of Ring functions.
2. Better existing functions like find() and type() updated to support C pointers.
3. An improved Ring Notepad that saves line numbers and prompts to save changes.
4. Enhancements to RingQt like disabling events and getting event information.
5. A new Objects library for RingQt applications to manage GUI objects and events.
6. An expanded RingLibCurl library for powerful LibCurl integration.
7. Support for calling methods from object attributes with
09.Local Database Files and Storage on WPNguyen Tuan
This document provides an overview of local data storage options for Windows apps, including isolated storage, file I/O, settings storage, SQLite database, and external storage. It discusses using the local, installation, and shared application folders to store files. It also covers serialization, file associations, and APIs for reading and writing files like IsolatedStorageFile and StorageFile. The document demonstrates saving data to isolated storage, settings, and a SQLite database and loading data from these sources. It recommends SQLite as a local database option and provides instructions for adding SQLite support to a project.
The document discusses various utility functions for performing file operations in QTP/UFT like creating, writing to, reading from, checking existence of, opening, copying, deleting files. It also discusses functions for operations with Excel sheets like reading cell data, and functions for operations like sending emails, displaying timed message boxes, simulating keystrokes, getting keyboard values, running applications, and using the clipboard.
1. FILE SYSTEM OBJECTS EXAMPLES
Examples:
i) Create a Folder
Dim objFso
Set objFso=CreateObject(“scripting.FileSystemObject”)
objFso.CreateFolder “C:Documents and Settings1 Desktophyderabad”
ii) Check if the Folder Exist or not? If not create the Folder
Dim objFso, myFolder
myFolder=”C:Documents and Settings1 Desktophyderabad”
Set objFso=CreateObject(“scripting.FileSystemObject”)
If Not objFso.FolderExists(myFolder) Then
objFso.CreateFolder (myFolder)
End If
iii) Copy a Folder
Dim objFso, myFolder
myFolder=”C:Documents and Settings1 Desktophyderabad”
Set objFso=CreateObject(“scripting.FileSystemObject”)
objFso.CopyFolder myFolder,”E:abcd”
iv) Delete a folder
Dim objFso, myFolder
myFolder=”C:Documents and Settings1Desktophyderabad”
Set objFso=CreateObject(“scripting.FileSystemObject”)
objFso.DeleteFolder( myFolder)
2nd
Dim objFso, myFolder
2. myFolder=”C:Documents and Settings1Desktophyderabad”
Set objFso=CreateObject(“scripting.FileSystemObject”)
If objFso.FolderExists(myFolder) Then
objFso.DeleteFolder( myFolder)
End If
v) Return a Collection of Disk Drives
Dim objFso, colDrives
Set objFso=CreateObject(“scripting.FileSystemObject”)
Set colDrives=objFso.Drives
For Each oDrive in colDrives
Msgbox oDrive
Next
vi) Get available space on a Drive
Dim objFso
Set objFso=CreateObject(“scripting.FileSystemObject”)
Set myDrive=objFso.GetDrive(“D:”)
Msgbox myDrive.AvailableSpace/(1024^3) & ” GB”
vii) Creating a Text File
Dim objFso
Set objFso=CreateObject(“scripting.FileSystemObject”)
objFso.CreateTextFile (“C:Documents and Settings1 Desktopabcd.txt”)
objFso.CreateTextFile (“C:Documents and Settings1 Desktopabcd.doc”)
objFso.CreateTextFile (“C:Documents and Settings1 Desktopabcd.xls”)
objFso.CreateTextFile (“C:Documents and Settings1 Desktopabcd.pdf”)
Note: We can Create other files also, but they act as Text/Flat Files
viii) Check if the File Exist or not? If not create the File
Dim objFso, myFile1,myFile2, myFile3, myFile4
3. myFile1=”C:Documents and Settings1 Desktopabcd.txt”
myFile2=”C:Documents and Settings1 Desktopabcd.doc”
myFile3=”C:Documents and Settings1 Desktopabcd.xls”
myFile4=”C:Documents and Settings1 Desktopabcd.pdf”
Set objFso=CreateObject(“scripting.FileSystemObject”)
If Not objFso.FileExists(myFile1) Then
objFso.CreateTextFile (myFile1)
End If
If Not objFso.FileExists(myFile2) Then
objFso.CreateTextFile (myFile2)
End If
If Not objFso.FileExists(myFile3) Then
objFso.CreateTextFile (myFile3)
End If
If Not objFso.FileExists(myFile4) Then
objFso.CreateTextFile (myFile4)
End If
ix) ReadData Character by Character from a text file
Dim objFso, myFile, myChar
Set objFso=CreateObject(“scripting.FileSystemObject”)
Set myFile=objFso.OpenTextFile(“C:Documents and Settings1 Desktopabcd.txt”,1) ’1 for Read,
2 for Write and 8 for Append
Do Until myFile.AtEndOfStream=True
myChar=myFile.Read(1)
Msgbox myChar
Loop
myFile.Close
Set objFso=Nothing
4. x)Read Line by Line from a Text File
Dim objFso, myFile, myChar
Set objFso=CreateObject(“scripting.FileSystemObject”)
Set myFile=objFso.OpenTextFile(“C:Documents and Settings1 Desktopabcd.txt”,1) ’1 for Read,
2 for Write and 8 for Append
Do Until myFile.AtEndOfStream=True
myChar=myFile.ReadLine
Msgbox myChar
Loop
myFile.Close
Set objFso=Nothing
xi) Data Driven Testing by fetching Test data directly from a Text file.
‘*****************************************************************************
********
‘Test Requirement: Data Driven Testing by fetching Test data directly from a Text file.
‘Author: xyz
‘Date of Creation: 24-08-2010
‘Pre-requasites:
‘abcd.txt (Test Data File)
‘Test Flow:
‘Create File System object
‘Open the file with Read mode and store reference into a variable
‘Skipe the first line
‘Read line by line and split the Data
‘Login Operation
‘Form Looping and pass Parameters
‘*****************************************************************************
********
5. Dim objFso, myFile, myLine, myField
Set objFso=CreateObject(“scripting.FileSystemObject”)
Set myFile=objFso.OpenTextFile(“C:Documents and Settings1 Desktopabcd.txt”,1) ’1 for Read,
2 for Write and 8 for Append
myFile.SkipLine
Do Until myFile.AtEndOfStream =True
myLine=myFile.ReadLine
myField=Split(myLine,”,”)
SystemUtil.Run “C:Program FilesHPQuickTest Professionalsamplesflightappflight4a.exe”
Dialog(“text:=Login”).Activate
Dialog(“text:=Login”).WinEdit(“attached text:=Agent Name:”).Set myField(0)
Dialog(“text:=Login”).WinEdit(“attached text:=Password:”).Set myField(1)
Wait 2
Dialog(“text:=Login”).WinButton(“text:=OK”).Click
Window(“text:=Flight Reservation”).Close
Loop
myFile.Close
Set objFso=Nothing
xii) Write Data to a Text File
Dim objFso, myFile, Result, a, b
a=10: b=20
Result=a+b
Set objFso=CreateObject(“scripting.FileSystemObject”)
Set myFile=objFso.OpenTextFile(“C:Documents and Settings1 Desktopabcd.txt”,2) ’1 for Read,
2 for Write and 8 for Append
myFile.WriteLine “Addition of a, b is: “&Result
myFile.Close
Set objFso=Nothing
6. xiii) Delete a Text File
Dim objFso
Set objFso=CreateObject(“scripting.FileSystemObject”)
objFso.DeleteFile(“C:Documents and Settings1 Desktopabcd.doc”)
Set objFso=Nothing
xiv) Check if the File Exists or not? If Exists delete the File
———–
Dim objFso
Set objFso=CreateObject(“scripting.FileSystemObject”)
If objFso.FileExists(“C:Documents and Settings1 Desktopabcd.pdf”) Then
objFso.DeleteFile(“C:Documents and Settings1 Desktopabcd.pdf”)
End If
Set objFso=Nothing
xv) Calculate size of a Text File
Dim objFso
Set objFso=CreateObject(“scripting.FileSystemObject”)
File_Size= objFso.GetFile(“C:Documents and Settings1 Desktopabcd.txt”).Size
Msgbox File_Size& ” Bytes”
Set objFso=Nothing
xvi)Compare Two Text File by Size, by Text and by Binary values
Option Explicit
Dim objFso, File1, File2, myFile1, myFile2, File_First, File_Second, Files_Compare
File1=”C:Documents and Settings1 abcd.txt”
File2=”C:Documents and Settings1 desktopxyz.txt”
Set objFso=CreateObject(“scripting.FileSystemObject”)
‘Comaring two text files by Size
If objFso.GetFile(File1).Size= objFso.GetFile(File2).Size Then
7. Msgbox “Files are Same in Size”
Else
Msgbox “Files are Not Same”
End If
‘Comaring two text files by Text
Set File_First=objFso.OpenTextFile(File1)
Set File_Second=objFso.OpenTextFile(File2)
myFile1=File_First.ReadAll
myFile2=File_Second.ReadAll
‘Msgbox myFile1
Files_Compare=strComp(myFile1,myFile2,1) ’1 for Texual Comparision
If Files_Compare=0 Then
Msgbox “Files are having Same Text”
Else
Msgbox “Files are having Different Text”
End If
‘Binary Comparision of Two Text Files
Files_Compare=strComp(myFile1,myFile2,0) ’0 for Binary Comparision (It is Default mode)
If Files_Compare=0 Then
Msgbox “Files are Equal”
Else
Msgbox “Files are Not Equal”
End If
Set objFso=Nothing
xvii) Count the number of times a word appears in a Text File
Option Explicit
Dim objFso, File1, myWord, myData, myFile, objRegEx, MatchesFound, TotMatches
8. File1=”C:Documents and Settings1 RIGHATWAYDesktopabcd.txt”
Set objFso=CreateObject(“scripting.FileSystemObject”)
Set myFile=objFso.OpenTextFile(File1)
myData=myFile.ReadAll
myWord=”QTP”
Set objRegEx= New RegExp ‘Creating Regular Expression Object
objRegEx.Pattern=myWord ‘Search string
objRegEx.Global=True ‘ Finding all Matches
objRegEx.IgnoreCase=True ‘ Ignoring Case
Set MatchesFound=objRegex.Execute(myData) ‘Executing the Total file data to find natches
TotMatches=MatchesFound.Count
Msgbox “Matches: “&TotMatches
Set objFso=Nothing
xviii) Capture all Button Names from Login dialog Box and Export to a Text File
Option Explicit
Dim objFso, FilePath, myFile, oButton, myButton, Buttons, i, TotButtons
FilePath=”C:Documents and Settings1 RIGHATWAYDesktopabcd.txt”
Set objFso=CreateObject(“scripting.FileSystemObject”)
Set myFile=objFso.OpenTextFile(FilePath,2)
myFile.WriteLine “Button Names”
myFile.WriteLine “————”
Set oButton=Description.Create
oButton(“micclass”).value=”WinButton”
SystemUtil.Run “C:Program FilesHPQuickTest Professionalsamplesflightappflight4a.exe”
Set Buttons=Dialog(“text:=Login”).ChildObjects(oButton)
TotButtons=Buttons.Count
For i= 0 to TotButtons-1 Step 1
9. myButton=Buttons(i).GetRoProperty(“text”)
myFile.WriteLine myButton
Next
myFile.Close
Set objFso=Nothing
xix) Capture Customer Names from 1 to 10 Orders in FR and export to a Text File
*****************************************************************
‘Test Requirement: Capture Customer names from 1 to 10 orders
‘and export to text file
‘Test Flow:
‘Create an object in File system class
‘Open the text file in write mode using File sytem object
‘Login Operation
‘Form Loop to open 1 to 10 orders
‘capture the Customer names and write to external text file
‘*****************************************************************
Dim objFso, myFile
Set objFso=CreateObject(“scripting.FilesystemObject”)
Set myFile=objFso.OpenTextFile(“C:Documents and Settingsgcr.GCRC-
9A12FBD3D9Desktopabc.txt”,2)
myFile.WriteLine “Customer Names”
myFile.WriteLine “———”
If Not Window(“Flight Reservation”).Exist(3) Then
SystemUtil.Run “C:Program FilesHPQuickTest
Professionalsamplesflightappflight4a.exe”,”",”C:Program FilesHPQuickTest
Professionalsamplesflightapp”,”open”
Dialog(“Login”).Activate
Dialog(“Login”).WinEdit(“Agent Name:”).Set “nagesh”
10. Dialog(“Login”).WinEdit(“Password:”).SetSecure
“4c9e05a626f9b6471971fb15474e791b28cc1ed0″
Dialog(“Login”).WinButton(“OK”).Click
End If
For Order_Number= 1 to 10 step 1
Window(“Flight Reservation”).Activate
Window(“Flight Reservation”).WinButton(“Button”).Click
Window(“Flight Reservation”).Dialog(“Open Order”).WinCheckBox(“Order No.”).Set “ON”
Window(“Flight Reservation”).Dialog(“Open Order”).WinEdit(“Edit”).Set Order_Number
Window(“Flight Reservation”).Dialog(“Open Order”).WinButton(“OK”).Click
wait 2
Customer_Name = Window(“Flight Reservation”).WinEdit(“Name:”).GetVisibleText()
myFile.WriteLine Customer_Name
Next
myFile.Close
Set objFso=Nothing
11. HOW TO WORK WITH EXCEL
'''Script to create a new excel file , write data
'''save the file with read and write protected
'''''pwd1 is for read protected pwd2 is for write protected
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Add
xl.DisplayAlerts=False
Set ws=wb.Worksheets("sheet1")
ws.cells(1,1)=100
ws.cells(1,2)=200
wb.Saveas "e:data2.xls",,"pwd1","pwd2"
wb.Close
Set xl=nothing
'''Script to open excel file ,which is read and write protected write data
'''''pwd1 is for read protected pwd2 is for write protected
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Open("e:data2.xls",0,False,5,"pwd1","pwd2")
xl.DisplayAlerts=False
Set ws=wb.Worksheets("sheet1")
ws.cells(1,2)="hello"
ws.cells(2,2)="new data"
wb.Save
wb.Close
Set xl=nothing
''Script to get the list of links in Google and do spell check
===============================================================
dim d
set mw=CreateObject("Word.Application")
set d=Description.Create
d("micclass").value="Link"
set a=Browser("Google").page("Google").childobjects(d)
for i=0 to a.count-1
mw.WordBasic.filenew
s=a(i).getROProperty("innertext")
mw.WordBasic.insert s
if mw.ActiveDocument.Spellingerrors.count>0 then
Reporter.ReportEvent 1,"Spelling","spelling error :"&s
end if
mw.ActiveDocument.Close(False)
next
12. mw.quit
set mw=nothing
=========================================
''''Script to check ON the checkboxes in yahoo mail inbox
=========================================
Dim d
Set d=Description.Create
d("micclass").value="WebCheckBox"
Set c=Browser("Inbox (17) - Yahoo! Mail").Page("Inbox (17) - Yahoo!
Mail").ChildObjects(d)
For i=1 to 10
c(i).set "ON"
Next
========================================
'''script to select a mail having subject 'hi' or 'HI'
========================================
n=Browser("yahoo").Page("yahoo").WebTable("Inbox").RowCount
For i=2 to n
s=Browser("yahoo").Page("yahoo").WebTable("Inbox").GetCellData(i,7)
If lcase(trim(s))="hi" Then
Browser("yahoo").Page("yahoo").WebCheckBox("index:="&i-1).set "ON"
End If
Next
========================================
'''''Function to send a mail
========================================
Function SendMail(SendTo, Subject, Body, Attachment)
Set otl=CreateObject("Outlook.Application")
Set m=otl.CreateItem(0)
m.to=SendTo
m.Subject=Subject
m.Body=Body
If (Attachment <> "") Then
Mail.Attachments.Add(Attachment)
End If
m.Send
otl.Quit
Set m = Nothing
Set otl = Nothing
End Function
Call SendMail("nagesh.rao46@gmail.com","hi","This is test mail for testing","")
'''''''''''''''create a new text file
=====================================================
Dim fs,f
Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.CreateTextFile("e:file1.txt")
13. f.WriteLine "hello"
f.WriteLine "this is sample data"
f.Close
Set fs=nothing
=====================================================
'''''''''''''''read data from a text file
=====================================================
Dim fs,f
Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("e:file1.txt",1)
While f.AtEndOfLine<>True
msgbox f.ReadLine
Wend
f.Close
Set fs=nothing
=====================================================
''''''''''create a new excel file and write data
=====================================================
Dim xl,wb,ws
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Add
Set ws=wb.Worksheets("sheet1")
ws.cells(1,1)=10
ws.cells(2,1)=20
ws.cells(3,1)=50
wb.SaveAs "e:file1.xls"
wb.Close
Set xl=nothing
=====================================================
'''''''open existing file and write data in second column in Sheet1
=====================================================
Dim xl,wb,ws
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Open("e:file1.xls")
Set ws=wb.Worksheets("sheet1")
ws.cells(1,2)="Testing"
ws.cells(2,2)="hyd"
ws.cells(3,2)="ap"
wb.Save
wb.Close
Set xl=nothing
=====================================================
'''''''''''read data from excel from rows and columns
=====================================================
Dim xl,wb,ws
Set xl=CreateObject("Excel.Application")
14. Set wb=xl.Workbooks.Open("e:file1.xls")
Set ws=wb.Worksheets("sheet1")
r=ws.usedrange.rows.count
c=ws.usedrange.columns.count
For i=1 to r
v=""
For j=1 to c
v=v&" "& ws.cells(i,j)
Next
print v
print "-----------------------"
Next
wb.Close
Set xl=nothing
======================================================
''''''''''''''''get the bgcolor in a cell in excel
======================================================
Dim xl,wb,ws
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Open("e:file3.xls")
Set ws=wb.Worksheets("sheet1")
r=ws.usedrange.rows.count
c=ws.usedrange.columns.count
For i=1 to r
For j=1 to c
x=ws.cells(i,j).interior.colorindex
msgbox x
Next
Next
wb.Close
Set xl=nothing
======================================================='
'''''''''''''''''''''create word and write data
=======================================================
dim mw
set mw=CreateObject("Word.Application")
mw.Documents.Add
mw.selection.typetext "hello"
mw.ActiveDocument.SaveAs "e:file1.doc"
mw.quit
set mw=nothing
=======================================================
''''''''''script will display all the doc files in all the drives in the system
========================================================
Dim mw
Set mw=CreateObject("Word.Application")
15. Set fs=createobject("Scripting.FileSystemObject")
Set d=fs.Drives
mw.FileSearch.FileName="*.doc"
For each dr in d
msgbox dr
mw.FileSearch.LookIn=dr
mw.FileSearch.SearchSubFolders=True
mw.FileSearch.Execute
For each i in mw.FileSearch.FoundFiles
print i
Set f=fs.GetFile(i)
print f.Name&" "&f.Size&" "&f.DateCreated
print "-------------------------------------------------------------------"
Next
Next
mw.Quit
==========================================================
'''''''''Open Internet Explorer and navigate to yahoomail
==========================================================
Dim ie
Set ie=CreateObject("InternetExplorer.Application")
ie.Visible=True
ie.Navigate "www.yahoomail.com"
x=Browser("CreationTime:=0").GetROProperty("title")
msgbox x
==========================================================
''''''Create word, Create table and write all the services names
==========================================================
Set mw = CreateObject("Word.Application")
mw.Visible = True
Set dc = mw.Documents.Add()
Set objRange = dc.Range()
dc.Tables.Add
objRange,1,3
Set objTable = dc.Tables(1)
x=1
strComputer = "."
Set wms=GetObject("winmgmts:" & strComputer & "rootcimv2")
Set colItems = wms.ExecQuery("Select * from Win32_Service")
For Each s in colItems
If x > 1 Then
objTable.Rows.Add()
End If
objTable.Cell(x, 1).Range.Font.Bold = True
objTable.Cell(x, 1).Range.Text = s.Name
objTable.Cell(x, 2).Range.text = s.DisplayName
16. objTable.Cell(x, 3).Range.text = s.State
x = x + 1
Next
*******************************************************************************************
'How do we validate links in web page and how to display linknames with status in excel
'*************************************************************************
Set objExcel=Createobject("excel.application")
objExcel.Visible=True
objExcel.Workbooks.Add
set objSheet=objExcel.ActiveSheet
objSheet.Cells(1,1)="LinkName"
set c1=objSheet.Cells(1,1)
C1.Font.color=vbblue
objSheet.Cells(1,2)="Expected URL"
set c2=objSheet.Cells(1,2)
C2.Font.color=vbblue
objSheet.Cells(1,3)="Actual URL"
set c3=objSheet.Cells(1,3)
C3.Font.color=vbblue
objSheet.Cells(1,4)="Status"
set c4=objSheet.Cells(1,4)
C4.Font.color=vbBlue
Set objDesc=Description.Create
objDesc("micclass").value="Link"
set objLinks=Browser("title:=.*").page("title:=.*").childobjects(objDesc)
msgbox objLinks.count
17. For i=0 to objLinks.count-35 step 1
strLinkName=Browser("title:=.*").page("title:=.*").Link("name:=.*","index:="&i).Getroproperty(
"name")
strExpUrl=Browser("title:=.*").page("title:=.*").Link("name:=.*","index:="&i).GetRoproperty("ur
l")
Browser("title:=.*").page("title:=.*").Link("name:=.*","index:="&i).click
Browser("title:=.*").Sync
strActUrl=Browser("title:=.*").GetROProperty("url")
If instr(strActUrl,strExpUrl)>0Then
Reporter.ReportEvent micPass,"Link Vaidation","Succeed"
objSheet.Cells(i+2,1)=strLinkName
objSheet.Cells(i+2,2)=strExpUrl
objSheet.Cells(i+2,3)=strActUrl
objSheet.Cells(i+2,4)="Pass"
Set C4=objSheet.Cells(i+2,4)
C4.Font.color=vbGreen
Else
Reporter.ReportEvent micFail,"Link Vaidation","Failed"
objSheet.Cells(i+2,1)=strLinkName
objSheet.Cells(i+2,2)=strExpUrl
objSheet.Cells(i+2,3)=strActUrl
objSheet.Cells(i+2,4)="Fail"
Set C4=objSheet.Cells(i+2,4)
C4.Font.color=vbRed
End If
Browser("title:=.*").Back
18. Next
set objWbook=objExcel.ActiveWorkbook
objWbook.SaveAs "C:OutPutdata.xls"
objExcel.Quit
Set objExcel=nothing
'*****************************************************************************
HOW DO WE VERIFY LINKS IN A WEB PAGE
******************************************************************************
On error resume next 'To handle run time error
''SystemUtil.CloseProcessByName "iexplore.exe"
Systemutil.Run "iexplore","https://login.sample.com/amserver/UI/Login"
Browser( "sample").Page("sample ").WebEdit("html id:=IDToken1").Set "56793287"
Browser("sample ").Page("sample ").WebEdit("html id:=IDToken2").Set "ranao2009"
Browser("sample ").Page("sample ").WebButton("html id:=signIn").Click
wait(10)
Browser("sample ").Dialog("text:=Security Information").Winbutton("text:=&Yes").click
If Browser("sample ").Page("sample ").Image("close_text_button").Exist(10) Then
Browser("sample ").Page("sample ").Image("close_text_button").Click
End if
Set objLinkDesc=Description.Create
objLinkDesc("micclass").value="Link"
'To count no of links in a web page
Set objLinks = Browser("sample ").Page("sample ").ChildObjects(objLinkDesc)
'Set objLinks=Browser("sample ").page("sample ").childobjects(objLinkDesc)
msgbox objLinks.count
For i=1 to objLinks.count-187 step 1
strTargetUrl=Browser("title:=.*").Page("title:=.*").Link("text:=.*","index:="&i).GetRoProperty("url")
print(strTargetUrl)
' Reporter.ReportEvent micDone,""&strTargetUrl,""
' objLinks(i).click
Browser("title:=.*").Page("title:=.*").Link("text:=.*","index:="&i).click
Browser("title:=.*").Sync
strActualUrl=Browser("title:=.*").GetROProperty("url")
Print(strActualUrl)
'Verify Link is navigating into the correct page
If instr(strTargetUrl,strActualUrl)>0 Then
Reporter.ReportEvent micPass,"Navigate to correct page","The Actual URL is"& vbcrlf
&strActualUrl& vbcrlf &"The Target URL is"& vbcrlf &strTargetUrl 'Report result to the QTP test log
Else
Reporter.ReportEvent micFail,"Navigate to wrong page","The Actual URL is"& vbcrlf
&strActualUrl& vbcrlf &"The Target URL is"& vbcrlf &strTargetUrl 'Report result to the QTP test log
19. End If
Browser("title:=.*").Page("title:=.*").Link("name:=SampleHomeLogo").click
Browser("title:=.*").Sync
Next
‘*************************************************************************
'How to select specified checkbox in a web table
‘***************************************************************************
intRowcount = Browser("Inbox (477) - Yahoo! Mail").Page("Inbox (477) - Yahoo!
Mail").WebTable("Inbox").RowCount()
For i=2 to intRowcount
strTxt=Browser("Inbox (477) - Yahoo! Mail").Page("Inbox (477) - Yahoo!
Mail").WebTable("Inbox").GetCellData(i,5)
If strcomp(strTxt,"FreeHotPasses")=0 Then
set objChkBox=Browser("Inbox (477) - Yahoo! Mail").Page("Inbox (477) -
Yahoo! Mail").WebTable("Inbox").ChildItem(i,2,"WebCheckBox",0)
objChkBox.set "ON"
End If
Next
‘*****************************************************************************
*****
‘Sample script on registration in realtor application
‘*****************************************************************************
**
systemutil.Run "iexplore","www.realtor.com"
20. If Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate
Listings,").WebElement("Welcome | Sign In | Sign").Exist Then
reporter.ReportEvent micPass,"Step 1","Test is Pass"
Else
Reporter.ReportEvent micFail,"Step 1","Test is Fail"
End if
Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate Listings,").Link("Sign Up").Click
If Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate
Listings,").WebElement("SIGN UP").Exist Then
Reporter.ReportEvent micPass,"Step2","Test is Pass"
else
Reporter.ReportEvent micFail,"Step 2","Test is Fail"
End if
UserId="nagesh.rao49"
Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate Listings,").WebEdit("WebEdit").Set
UserId&"@gmail.com"
Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate
Listings,").WebEdit("WebEdit_2").SetSecure "4c697cca0717f1d0d617bead25615149f6b4"
Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate
Listings,").WebEdit("WebEdit_3").SetSecure "4c697cce3c61c2ec9481da3cd6ab89da7bd9"
Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate Listings,").WebList("select").Select
"Female"
Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate Listings,").WebEdit("WebEdit_4").Set
"1980"
Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate Listings,").Link("Sign Up_2").Click
21. If Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate Listings,").WebElement("THANK
YOU").Exist Then
Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate Listings,").Link("CLOSE").Click
End if
‘***********************************************************************
' How to delete cookies
‘*************************************************************************
systemutil.Run "iexplore","www.realtor.com"
webutil.DeleteCookies
systemutil.CloseDescendentProcesses
‘************************************************************************
'How to validate Links in specified web page
‘***************************************************************************
Set objLinkDesc=Description.Create
objLinkDesc("micclass").value="Link"
set objLinks=Browser("title:=.*").Page("title:=.*").ChildObjects(objLinkDesc)
msgbox objLinks.count
For i=0 to objLinks.count-5
strExpUrl=
Browser("title:=.*").page("title:=.*").Link("text:=.*","index:="&i).Getroproperty("url")
Browser("title:=.*").page("title:=.*").Link("text:=.*","index:="&i).click
' strExpUrl=objLinks(i).Getroproperty("url")
'Browser("title:=.*").page("title:=.*").Link("text:=.*","index:="&i).click
22. 'objLinks(i).click
Browser("title:=.*").Sync
strActUrl=Browser("title:=.*").GetROProperty("url")
If instr( strExpUrl,strActUrl)>0 Then
Reporter.ReportEvent micPass,"Link validation","Test is pass"
Else
Reporter.ReportEvent micFail,"Link validation","Test is Fail"
End If
Browser("title:=.*").Back
'Browser("Commercial Real Estate").Page("Commercial Real Estate").Image("REALTOR.com® -
Official").Click
Browser("title:=.*").Sync
'wait(10)
Next
‘****************************************************************
'How to set link names of specified page and keep them into a excel file
‘****************************************************************
Set objExcel=Createobject("Excel.application")
objExcel.Visible=True
objExcel.Workbooks.Add
set objsheet=objExcel.ActiveSheet
objsheet.cells(1,1)="LinkName"
set C=objsheet.cells(1,1)
c.font.color=vbblue
Set objLinkdesc=Description.Create
23. objLinkdesc("micclass").value="Link"
Set
objLinks=Browser("title:=.*").Page("title:=.*").ChildObjects(objLinkdesc)
For i=0 to objLinks.count-1
strLinkname=objLinks(i).GetRoproperty("name")
objsheet.cells(i+2,1)=strLinkname
Next
set objWbook=objExcel.ActiveWorkbook
objWbook.SaveAs("C:Demo.xls")
objExcel.Quit
Set objExcel=nothing
‘*****************************************************************************
*********
p = Browser("Inbox (477) - Yahoo! Mail").Page("Real Estate Listings,").WebElement("Welcome,
nagesh.rao48").GetROProperty("innertext")
arr=split(p,",")
If trim(arr(1))=UserId Then
Reporter.ReportEvent micPass,"Step 3","Test is Pass"
Else
Reporter.ReportEvent micFail,"Step 3","Test is Fail"
24. End If
‘***********************************************************************
‘************************************************************************
'How to focus the cursor on the object and howto select the itemsfrom dropdown
‘*************************************************************************
x = Browser("Google").Page("Google").WebEdit("q").GetROProperty("abs_x")
y=Browser("Google").Page("Google").WebEdit("q").GetROProperty("abs_y")
'
Set objDevice=Createobject("mercury.Devicereplay")
objDevice.Mouseclick x,y,0
Set objShell=Createobject("wscript.shell")
objShell.SendKeys "q"
wait(4)
Set objDesc=Description.Create
objDesc("micclass").value="WebElement"
objDesc("name").value="Google Search"
set objWele=Browser("Google").Page("Google").WebTable("qtp interview
questions").ChildObjects(objDesc)
msgbox objWele.count
For i= 0 to objWele.count-1 step 1
objShell.SendKeys"{DOWN}"
25. strName=objWele(i).GetRoproperty("innertext")
Reporter.ReportEvent micDone,"Item Name--"&strName,"Item Captured"
Next
Set objDevice=Nothing
Set objShell=nothing
******************************************************************************
**********************
'How to focus the cursor on the object
'Browser("Google").Page("Welcome: Mercury Tours").Image("Desinations").Click
'x=Browser("Google").Page("Welcome: Mercury
Tours").Image("Desinations").GetROProperty("abs_x")
'y=Browser("Google").Page("Welcome: Mercury
Tours").Image("Desinations").GetROProperty("abs_y")
'
' Set objDevice=Createobject("Mercury.Devicereplay")
' objDevice.MouseMove x,y
' wait(10)
''*****************************************************************************
*************************************