You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/comtypes/test/test_QueryService.py

28 lines
700 B

import unittest
from ctypes import POINTER
import comtypes
from comtypes.client import CreateObject, GetModule
GetModule('oleacc.dll')
from comtypes.gen.Accessibility import IAccessible
class TestCase(unittest.TestCase):
def setUp(self):
self.ie = CreateObject('InternetExplorer.application')
def tearDown(self):
self.ie.Quit()
del self.ie
def test(self):
ie = self.ie
ie.navigate2("about:blank", 0)
sp = ie.Document.Body.QueryInterface(comtypes.IServiceProvider)
pacc = sp.QueryService(IAccessible._iid_, IAccessible)
self.assertEqual(type(pacc), POINTER(IAccessible))
if __name__ == "__main__":
unittest.main()