frankvanderkuur / robotframework-sapguilibrary

A Robot Framework Library for automating the SAP GUI desktop client
Apache License 2.0
51 stars 20 forks source link

Multi Threading with SapGuiLibray #4

Open H1bertto opened 5 years ago

H1bertto commented 5 years ago

Hi all,

I forked this repo, and add threading in the connect session because when I tried to use multithreading returned this pythoncom error:

'Coinitialize has not been called'

Then before run: rot = pythoncom.GetRunningObjectTable()

I inserted: if threading.currentThread().getName() != 'MainThread': pythoncom.CoInitialize()

And everything worked perfectly, without affecting any other part of the library!

See the diff here: https://github.com/H1bertto/robotframework-sapguilibrary/commit/3e75680e15a590f8cb15c5e327ace2d9f8f368f5