How to connect Microsoft Excel connection using ODBC?
[Example below using VB Code:]
Dim XlFile: XlFile="C:\MyExcel.xls"
Dim AdodbCn
Set AdodbCn = CreateObject("ADODB.Connection")
AdodbCn.ConnectionString = "Driver={Microsoft Excel Driver (*.xls)}; DBQ=" & XlFile &"; HDR=Yes; IMEX=1;"
'HDR=Yes;" indicates that the first row contains columnnames, not data
'IMEX=1;" tells the driver to always read "intermixed" data columns as text
AdodbCn.Open
Thursday, November 20, 2008
Thursday, October 30, 2008
Trim: Can't Find Project Or Library
This error occur when you do not have (Office XP Tool: Web Components).
Locate the installer from Microsoft site and installed the same will resolve the issue.
-Restart the application and try, I am sure the issue will go
Locate the installer from Microsoft site and installed the same will resolve the issue.
-Restart the application and try, I am sure the issue will go
Thursday, September 4, 2008
Why PDM is essential for QTP Automation Engineer?
What is PDM?
PDM stands for Microsoft Process Debug Manager, which allow you to debug QTP on runtime.
Where to get the PDM?
http://www.processlibrary.com/directory/files/pdm/21442
PDM stands for Microsoft Process Debug Manager, which allow you to debug QTP on runtime.
Where to get the PDM?
http://www.processlibrary.com/directory/files/pdm/21442
Monday, August 25, 2008
How to get the data from selected row QTP?
Dim webElement, childAttrib, tableRow
Set webElement= Browser(<"Browser">).Page(<"Page">).WebTable(<"WebTable">).Object.getElementsByTagName("TR")
tableRow= Browser(<"Browser">).Page(<"Page">).WebTable(<"WebTable">).RowCount
For i=1 to tableRow-1
Set childAttrib= webElement(i).attributes
Print childAttrib("class").value
Next
More Info:
http://developer.mozilla.org/En/DOM:document.getElementsByTagName
Set webElement= Browser(<"Browser">).Page(<"Page">).WebTable(<"WebTable">).Object.getElementsByTagName("TR")
tableRow= Browser(<"Browser">).Page(<"Page">).WebTable(<"WebTable">).RowCount
For i=1 to tableRow-1
Set childAttrib= webElement(i).attributes
Print childAttrib("class").value
Next
More Info:
http://developer.mozilla.org/En/DOM:document.getElementsByTagName
Sunday, August 10, 2008
How to remove multiple space in a string QTP?
Function trimAll (ByVal strString)
Dim sLen
sLen=Len(strString)
Do
sLen=sLen-1
strString=Replace(strString, Space(sLen), " ")
Loop Until sLen=2
trimAll=strString
End Function
Dim sLen
sLen=Len(strString)
Do
sLen=sLen-1
strString=Replace(strString, Space(sLen), " ")
Loop Until sLen=2
trimAll=strString
End Function
How to create ISO Image from CD/DVD using Linux comand
Procedure to create CD/DVD iso image using linux command:
- Check the CD/DVD mount location
- ls /media or ls /mnt or cat /etc/mtab or cat /etc/fstab
- Now insert the media and unmount the same
- ex: sudo umount /media/sr0 or /mnt/sdrom
- Issue following command would create ISO image for the same
- dd if=
of= - ex: on my system it would be dd if=/dev/sr0 of=/tmp/myimage.iso
Monday, April 21, 2008
QTP Code Generate Random String
Function GetRandomString (ByVal strLength)
Dim i, strRand
Const sChr ="a"
Randomize
For i = 0 To strLength-1
strRand = strRand + Chr(Asc(sChr) + Rnd() * 25 )
If i = 0 Then
strRand = Ucase(strRand)
End If
Next
GetRandomString = strRand
End Function
'Ex: To get a random string with 5 characters use following call
Print GetRandomString (5)
Dim i, strRand
Const sChr ="a"
Randomize
For i = 0 To strLength-1
strRand = strRand + Chr(Asc(sChr) + Rnd() * 25 )
If i = 0 Then
strRand = Ucase(strRand)
End If
Next
GetRandomString = strRand
End Function
'Ex: To get a random string with 5 characters use following call
Print GetRandomString (5)
Subscribe to:
Posts (Atom)