Hello, sir.
I work with tests automation with selenium and many languages (Python, Ruby, Java, C, C++).
From what I read here, you have a missed parameter to put inside the function calling, maybe it's being Null or something else. I only can give you the certain of the defect seeing the code.
I'm novice at this "freelancer" platform, but if you want, you can talk with me to see some projects.
Best regards.