Hello,
Does anyone know a workaround for calling fireEvent.
With the latest from Microsoft OS XP2 and Hot fixes to
IE it now gives an "access denied" error in Python when called.
Here is what I am trying to do:
Set the "campus" listbox value and theb call fire event, such as in the
code below. I get an "access denied" error.
example code:
ie = DispatchEx('Int ernetExplorer.A pplication')
# Some code to navigate to the site, wait till doc is not busy and #
ReadyState is complete...blah ..blah...
ie.Document.for ms[0].campus.value = '200'
ie.Document.for ms[0].campus.fireEve nt('onchange')
HTML code:
<select style="font-size: 10" name="campus" onChange="if
(this.options[this.selectedIn dex].value != 0)
populate(this.o ptions[this.selectedIn dex].value)">
<option value=0>Select a campus
<option value="200">Nor man Campus
<option value="501">Adv anced Programs
<option value="502">Lib eral Studies
<option value="504">Aca demic Programs (CAFE)
<option value="505">OU Tulsa</select>
If you call:
fireEvent('onch ange')
fireEvent('oncl ick')
fireEvent('onFo cus') etc... You will get an Access Denied
This only happens with either the newer version of IE and XP2.
I was able to call the exact same code with XP1 and Win2000 Pro
and it work fine. So something has changed with I.E. and is not being
handled in Python.
example code:
ie.Document.for ms[0].campus.fireEve nt('onchange')
Trace:
File
"C:\Python23\Li b\site-packages\python win\pywin\frame work\scriptutil s.py",
line 310, in RunScript
exec codeObject in __main__.__dict __
File "C:\QA\Tools\cP AMIE150\oCScrip t2.py", line 24, in ?
ie2.Document.fo rms[0].campus.fireEve nt('onchange')
File "C:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line
165, in __call__
return
self._get_good_ object_(self._o leobj_.Invoke(* allArgs),self._ olerepr_.defaul tDispatchName,N one)
com_error: (-2147024891, 'Access is denied.', None, None)
Help would be much appreciated!!
RLM
Does anyone know a workaround for calling fireEvent.
With the latest from Microsoft OS XP2 and Hot fixes to
IE it now gives an "access denied" error in Python when called.
Here is what I am trying to do:
Set the "campus" listbox value and theb call fire event, such as in the
code below. I get an "access denied" error.
example code:
ie = DispatchEx('Int ernetExplorer.A pplication')
# Some code to navigate to the site, wait till doc is not busy and #
ReadyState is complete...blah ..blah...
ie.Document.for ms[0].campus.value = '200'
ie.Document.for ms[0].campus.fireEve nt('onchange')
HTML code:
<select style="font-size: 10" name="campus" onChange="if
(this.options[this.selectedIn dex].value != 0)
populate(this.o ptions[this.selectedIn dex].value)">
<option value=0>Select a campus
<option value="200">Nor man Campus
<option value="501">Adv anced Programs
<option value="502">Lib eral Studies
<option value="504">Aca demic Programs (CAFE)
<option value="505">OU Tulsa</select>
If you call:
fireEvent('onch ange')
fireEvent('oncl ick')
fireEvent('onFo cus') etc... You will get an Access Denied
This only happens with either the newer version of IE and XP2.
I was able to call the exact same code with XP1 and Win2000 Pro
and it work fine. So something has changed with I.E. and is not being
handled in Python.
example code:
ie.Document.for ms[0].campus.fireEve nt('onchange')
Trace:
File
"C:\Python23\Li b\site-packages\python win\pywin\frame work\scriptutil s.py",
line 310, in RunScript
exec codeObject in __main__.__dict __
File "C:\QA\Tools\cP AMIE150\oCScrip t2.py", line 24, in ?
ie2.Document.fo rms[0].campus.fireEve nt('onchange')
File "C:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line
165, in __call__
return
self._get_good_ object_(self._o leobj_.Invoke(* allArgs),self._ olerepr_.defaul tDispatchName,N one)
com_error: (-2147024891, 'Access is denied.', None, None)
Help would be much appreciated!!
RLM
Comment