Re: failed ImportError: No module named win32gui on Windows7 running robotframework

1,086 views
Skip to first unread message

Kevin O.

unread,
Mar 29, 2013, 5:03:29 PM3/29/13
to robotframe...@googlegroups.com
Jython does not support C Extensions - see here.

Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32gui
>>> win32gui.__file__
'C:\\apps\\Python27\\lib\\site-packages\\win32\\win32gui.pyd'
>>>

.pyd files are C extensions

Samuel Kamau

unread,
Apr 1, 2013, 10:37:20 AM4/1/13
to robotframe...@googlegroups.com
Hi Kevin O
But we are not experiencing this issue on Windows XP running same script and setup for Robot and selenium RC. We are getting it in Windows 7.



On Friday, March 29, 2013 1:15:45 PM UTC-4, Samuel Kamau wrote:
We arte experiencing Errors when we run Robotframe work on windows7. The Script runs and selenium launches the browser but we do not see our webpage loaded it remains in a blank state. We get this Error on RobotFramework.

c:\Python27\Scripts>jybot.bat c:\Automation\robot_framework\ui_testing\vuln_mgmt
\test_suites\login\invalid_login.txt
[ ERROR ] Error in file 'c:\Automation\robot_framework\ui_testing\common\lib\res
ources\standard.txt' in table 'Settings': Importing test library 'c:\Automation\
robot_framework\ui_testing\unity\lib\keywords\python_functions.py' failed: Impor
tError: No module named win32gui
Traceback (most recent call last):
  File "c:\Automation\robot_framework\ui_testing\unity\lib\keywords\python_funct
ions.py", line 9, in <module>
    import win32gui
PYTHONPATH:
  C:\Python27\Lib\site-packages\robot\libraries
  C:\Python27\Lib\site-packages
  C:\jython2.5.2\Lib
  __classpath__
  __pyclasspath__/
  C:\jython2.5.2\Lib\site-packages
  .
  c:\Python27\Scripts
CLASSPATH:
  C:\jython2.5.2\jython.jar
[ ERROR ] Error in file 'c:\Automation\robot_framework\ui_testing\common\lib\res
ources\standard.txt' in table 'Settings': Importing test library 'c:\Automation\
robot_framework\ui_testing\unity\lib\keywords\python_functions.py' failed: Impor
tError: No module named win32gui
Traceback (most recent call last):
  File "c:\Automation\robot_framework\ui_testing\unity\lib\keywords\python_funct
ions.py", line 9, in <module>
    import win32gui
PYTHONPATH:
  C:\Python27\Lib\site-packages\robot\libraries
  C:\Python27\Lib\site-packages
  C:\jython2.5.2\Lib
  __classpath__
  __pyclasspath__/
  C:\jython2.5.2\Lib\site-packages
  .
  c:\Python27\Scripts
CLASSPATH:
  C:\jython2.5.2\jython.jar

For some reason win32Gui cannot be found but it is installed.I made my own python script to call win32Gui and it runs well. It cannot find it when I use Robot. 

Kevin O.

unread,
Apr 1, 2013, 11:04:27 AM4/1/13
to robotframe...@googlegroups.com
Are you sure you aren't running the tests on the XP box with pybot(CPython) and you attempted to run on Windows 7 with jybot(Jython) on accident?

Samuel Kamau

unread,
Apr 1, 2013, 11:18:04 AM4/1/13
to robotframe...@googlegroups.com
I am

Kevin O.

unread,
Apr 1, 2013, 11:22:54 AM4/1/13
to robotframe...@googlegroups.com
I am not able to import win32gui on an XP box running Jython 2.5.3.
import win32gui on CPython...success
import robot in Jython...success (robot is not in Jython's site-packages only in CPython's)
import  win32gui on Jython...failed for same reason.

Can you import it from the Jython command line (may have to adjust paths)?

Samuel Kamau

unread,
Apr 1, 2013, 11:48:42 AM4/1/13
to robotframe...@googlegroups.com
I have actually noticed we do get the same Error on XP but the script works and opens the webpage. But on windows 7 the browser goes to C:\Users\User1\AppData\Local\Temp\customprofile\Core\blank.html. So the win32Gui is not the issue. But I am still wondering why I am getting different behavior on Win 7. The browser does not navigate to our site.

Kevin O.

unread,
Apr 1, 2013, 2:10:52 PM4/1/13
to robotframe...@googlegroups.com
Wish I could help but I haven't used RC in a longtime. I started with WebDriver.

Samuel Kamau

unread,
Apr 2, 2013, 10:31:03 AM4/2/13
to robotframe...@googlegroups.com
Hi Kevin
You actually did help. I was able to get it to work. Windows 7 cannot use Selenium RC libraries any more so I went and got the Selenium2Libraries that contain web driver and that cured my problems. Thanks again

Jerry Schneider

unread,
Apr 2, 2013, 10:45:00 AM4/2/13
to robotframe...@googlegroups.com
We had a similar issue on Mac where the latest (2.9.1) SeleniumLibrary would not run.  We downgraded to 2.9 and now it works.  We are in the process of converting to Selenium2Library now though.

jer
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Linux registered user #475536
Ubuntu registered user #28583

Kevin O.

unread,
Apr 2, 2013, 11:09:47 AM4/2/13
to robotframe...@googlegroups.com, jer...@gmail.com
Glad to hear you got it working. Were you using the old Google Groups when you wrote the first post?
Your original plain-text post does not wrap at all in Chrome or IE8 and so I missed most of your problem description.
Your replies do wrap.
I hope Google fixes that.

Samuel Kamau

unread,
Apr 2, 2013, 4:42:41 PM4/2/13
to robotframe...@googlegroups.com
have you done continuous integration with jenkins and robotframework. I am working on this right now

Kevin O.

unread,
Apr 3, 2013, 1:18:43 PM4/3/13
to robotframe...@googlegroups.com
I have. We have 5 slaves to execute RF tests.
Since RF lacks any kind of concurrent testing, we created some master jobs which trigger other jobs.
When all triggered jobs are done, the output.xml files are copied into the master job and run through rebot to aggregate the results.
It is frustratingly complicated, but effective.
I'm curious how others are approaching this.

By the way I made a blog post on getting RF test results in an email at the end of a job. Others have found it useful.

Kevin

Markus Bernhardt

unread,
Apr 3, 2013, 2:08:59 PM4/3/13
to korm...@gmail.com, robotframe...@googlegroups.com
Hi Kevin,

I'm actually extending the RF maven plugin for concurrent testing, automatic load balancing, definition of atomic testsuites, etc. 
We plan to execute 1200 Selenium2Library testcases in 30 concurrent sessions against the SauceLab grid.

But you are right RF is not prepared for that. We first tried to integrate that into RF, but there are too much problems
with thread safety, especially in the libraries. Thats why we do now exactly the same. But automated.
  • Analyze the runtime of the last runs of the testcases
  • Span several separate sessions
  • Combine the results afterwards

Cheers,
Markus

Reply all
Reply to author
Forward
0 new messages