Difference between revisions of "Accessing LoadRunner Analysis Repository with Python ADO"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (New page: <pre> import time import win32com.client engine = engine = win32com.client.Dispatch("DAO.DBEngine.36") db = engine.OpenDatabase(r"c:\lr\py\analysis.mdb") rs = db.OpenRecordset("Result")...) |
PeterHarding (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<pre> | <pre> | ||
import time | import time | ||
import win32com.client | import win32com.client | ||
engine = engine = win32com.client.Dispatch("DAO.DBEngine.36") | engine = engine = win32com.client.Dispatch("DAO.DBEngine.36") | ||
db = engine.OpenDatabase(r"c:\lr\py\analysis.mdb") | db = engine.OpenDatabase(r"c:\lr\py\analysis.mdb") | ||
rs = db.OpenRecordset("Result") | rs = db.OpenRecordset("Result") | ||
Line 23: | Line 23: | ||
print "Start Time: %s " % time.asctime(time.localtime(startTime)) | print "Start Time: %s " % time.asctime(time.localtime(startTime)) | ||
print " End Time: %s " % time.asctime(time.localtime(endTime)) | print " End Time: %s " % time.asctime(time.localtime(endTime)) | ||
</pre> | </pre> | ||
[[Category:Python]] | [[Category:Python]] | ||
[[Category:Examples]] | |||
[[Category:LoadRunner]] | [[Category:LoadRunner]] |
Latest revision as of 17:35, 24 September 2014
import time import win32com.client engine = engine = win32com.client.Dispatch("DAO.DBEngine.36") db = engine.OpenDatabase(r"c:\lr\py\analysis.mdb") rs = db.OpenRecordset("Result") while not rs.EOF: scenario = rs.Fields("Scenario Name").Value name = rs.Fields("Result Name").Value tz = rs.Fields("Time Zone").Value / 3600 startTime = rs.Fields("Start Time").Value endTime = rs.Fields("Result End Time").Value rs.MoveNext() print print " Scenario: %s " % scenario print " Run ID: %s " % name print " TZ: %s " % tz print "Start Time: %s " % time.asctime(time.localtime(startTime)) print " End Time: %s " % time.asctime(time.localtime(endTime))