SlideShare uma empresa Scribd logo
1 de 9
Baixar para ler offline
QTP SCRIPTS http://www.funandknowledge.blogspot.com/
QTP Script for connecting to database(MS Access) Option Explicit Dim con,rs Set con=createobject("adodb.connection") Set rs=createobject("adodb.recordset") con.provider="microsoft.jet.oledb.4.0" con.open"d:estdata.mdb" rs.open"select*from emp",con Do while not rs.eof VbWindow("Form1").VbEdit("val1").Set rs.fields("v1") VbWindow("Form1").VbEdit("val2").Set rs.fields("v2") VbWindow("Form1").VbButton("ADD").Click rs.movenext Loop
Database we are using here is MS Access.before running this script create a table in MS Acess. In the above script i used table called "emp" and column names as "v1" and "v2". "d:estdata.mdb" is path of the table which we created.  Main use of this application is to use testdata of table(which is in database) in the application. http://www.funandknowledge.blogspot.com/
DataDriven Testing using ExcelSheet instead of Datatable This is script for data driven using excel sheet. In this script we are not importing excel sheet to datatable.Directly values are supplied to application from excel sheet. Set ex= CreateObject("Excel.Application") Set a=ex.Workbooks.open("D:xcel.xls") Set b=a.worksheets("Sheet1") dim login,pwd for i=1 to 3 login=b.Cells(i,"A").value  pwd=b.Cells(i,"B").value msgbox login msgbox pwd  next
"D:xcel.xls" is path of excel sheet. "sheet1"indicates sheet name in which values are present. A,B are column names in excel sheet. we have excel sheet with values as shown below in d drive. A B 1 2 3 4 5 6 http://www.funandknowledge.blogspot.com/
Descriptive Programming to Create Folder in System Set obj=createobject ("scripting.filesystemobject") Set notepad=obj.createfolder("d:abc") this script will create a folder named "abc" in "d" drive.   http://www.funandknowledge.blogspot.com/
Timeout for MessageBox Script for MessageBox to disappear after particular time without clicking on ok button manually . Set a=createobject("wscript.shell") msgbox_message="Message Box will close by itself in 10seconds so dont click on OK button" msgbox_time="10" msgbox_title="Testing" a.popup msgbox_message,msgbox_time,msgbox_title Where time is in seconds. http://www.funandknowledge.blogspot.com/
Descriptive Programming for Yahoo Login Page SystemUtil.Run"iexplore","http://www.yahoomail.com" Set g=Browser("name:=Yahoo.*").Page("title:=Yahoo.*") g.WebEdit("name:=login").Set "aaa" g.WebEdit("name:=passwd").SetSecure "bbb" g.WebButton("name:=Sign In").Click g.Link("name:=Inbox.*", "html id:=WelcomeInboxFolderLink").Click g.Link("name:=Sign Out").Click http://www.funandknowledge.blogspot.com/
SystemUtil.Run"iexplore","http://www.yahoomail.com" statement opens yahoo login page aaa=username bbb=password For more QTP Scripts

Mais conteúdo relacionado

Destaque (19)

Red social
Red socialRed social
Red social
 
Enunciado
EnunciadoEnunciado
Enunciado
 
Manifesto nacional de apoio à Dilma - servidores do Judiciário e MPU
Manifesto nacional de apoio à Dilma - servidores do Judiciário e MPUManifesto nacional de apoio à Dilma - servidores do Judiciário e MPU
Manifesto nacional de apoio à Dilma - servidores do Judiciário e MPU
 
Acredita em missoes
Acredita em missoesAcredita em missoes
Acredita em missoes
 
Como registrar tus obras musicales
Como registrar tus obras musicalesComo registrar tus obras musicales
Como registrar tus obras musicales
 
Cable utp
Cable utpCable utp
Cable utp
 
Lluvia de ideas sobre calidad
Lluvia de ideas sobre calidadLluvia de ideas sobre calidad
Lluvia de ideas sobre calidad
 
Biografia marx
Biografia marxBiografia marx
Biografia marx
 
Bo 17 04-2012-25
Bo 17 04-2012-25Bo 17 04-2012-25
Bo 17 04-2012-25
 
Bilogia
BilogiaBilogia
Bilogia
 
La tectónica de placas
La tectónica de placasLa tectónica de placas
La tectónica de placas
 
alejo
alejoalejo
alejo
 
Deposit Reclassification
Deposit ReclassificationDeposit Reclassification
Deposit Reclassification
 
Boletim 439 - 12/07/15
Boletim 439 - 12/07/15Boletim 439 - 12/07/15
Boletim 439 - 12/07/15
 
Japan
JapanJapan
Japan
 
Oraçao do veterinario
Oraçao do veterinarioOraçao do veterinario
Oraçao do veterinario
 
0001
00010001
0001
 
Apresentação1
Apresentação1Apresentação1
Apresentação1
 
Comunicado Hospital Emergencias Grau Julio 2105
Comunicado Hospital Emergencias Grau Julio 2105Comunicado Hospital Emergencias Grau Julio 2105
Comunicado Hospital Emergencias Grau Julio 2105
 

Último

Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 

Último (20)

Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 

Qtp Scripts

  • 2. QTP Script for connecting to database(MS Access) Option Explicit Dim con,rs Set con=createobject("adodb.connection") Set rs=createobject("adodb.recordset") con.provider="microsoft.jet.oledb.4.0" con.open"d:estdata.mdb" rs.open"select*from emp",con Do while not rs.eof VbWindow("Form1").VbEdit("val1").Set rs.fields("v1") VbWindow("Form1").VbEdit("val2").Set rs.fields("v2") VbWindow("Form1").VbButton("ADD").Click rs.movenext Loop
  • 3. Database we are using here is MS Access.before running this script create a table in MS Acess. In the above script i used table called "emp" and column names as "v1" and "v2". "d:estdata.mdb" is path of the table which we created. Main use of this application is to use testdata of table(which is in database) in the application. http://www.funandknowledge.blogspot.com/
  • 4. DataDriven Testing using ExcelSheet instead of Datatable This is script for data driven using excel sheet. In this script we are not importing excel sheet to datatable.Directly values are supplied to application from excel sheet. Set ex= CreateObject("Excel.Application") Set a=ex.Workbooks.open("D:xcel.xls") Set b=a.worksheets("Sheet1") dim login,pwd for i=1 to 3 login=b.Cells(i,"A").value pwd=b.Cells(i,"B").value msgbox login msgbox pwd next
  • 5. "D:xcel.xls" is path of excel sheet. "sheet1"indicates sheet name in which values are present. A,B are column names in excel sheet. we have excel sheet with values as shown below in d drive. A B 1 2 3 4 5 6 http://www.funandknowledge.blogspot.com/
  • 6. Descriptive Programming to Create Folder in System Set obj=createobject ("scripting.filesystemobject") Set notepad=obj.createfolder("d:abc") this script will create a folder named "abc" in "d" drive. http://www.funandknowledge.blogspot.com/
  • 7. Timeout for MessageBox Script for MessageBox to disappear after particular time without clicking on ok button manually . Set a=createobject("wscript.shell") msgbox_message="Message Box will close by itself in 10seconds so dont click on OK button" msgbox_time="10" msgbox_title="Testing" a.popup msgbox_message,msgbox_time,msgbox_title Where time is in seconds. http://www.funandknowledge.blogspot.com/
  • 8. Descriptive Programming for Yahoo Login Page SystemUtil.Run"iexplore","http://www.yahoomail.com" Set g=Browser("name:=Yahoo.*").Page("title:=Yahoo.*") g.WebEdit("name:=login").Set "aaa" g.WebEdit("name:=passwd").SetSecure "bbb" g.WebButton("name:=Sign In").Click g.Link("name:=Inbox.*", "html id:=WelcomeInboxFolderLink").Click g.Link("name:=Sign Out").Click http://www.funandknowledge.blogspot.com/
  • 9. SystemUtil.Run"iexplore","http://www.yahoomail.com" statement opens yahoo login page aaa=username bbb=password For more QTP Scripts