0

I have run against a really simple problem, but I cannot solve it properly. Namely I am running automated test cases written in Python 3 + Selenium. The tests are going to be executed in Docker to isolate the Python environment from the machine it will be executed on (this is required).

I have noticed that there is a communication problem between the Selenium Hub and Selenium Nodes, which is described in : https://github.com/SeleniumHQ/selenium/issues/3808 . There is a workaround provided which boils down to changing one line of code in the selenium library.

I have already forked the git source of the library, edited the code. Now I need to add it to my project, preferably as a compiled library, as I do not plan to do any edits

Unfortunately this is where I fail. 1. I cannot find any proper tutorial to teach me how to handle this issue, despite it being really elementary. 2. I cannot find the supposedly compiled library after I execute in the console: exclude_path_regex=re.compile(r'third_party') compileall.compile_dir("C:\Users\bchmura\PycharmProjects\selenium\py\selenium",rx=exclude_path_regex) (it outputs 'True' and that's it ... no .pyc file that I can find, or not even a file with today's modification date....)

Therefore my question: how can I:

  • properly compile a modified library in python 3.x?
  • then include it in my project?
  • if possible, how can I properly make my forked git version of the code and then install it using pip on my target environment?

Links to tutorials that will let me achieve the goal are also helpful.

glamredhel
  • 336
  • 3
  • 12
  • 1
    A few tips: First of all, `compileall.compile_dir()` almost certainly isn't the right tool to use here. That simply builds Python bytecode, which generally isn't necessary. I think you should be following [the build instructions](https://github.com/SeleniumHQ/selenium#building). Next, it looks like this should all be resolved now. Have you tried upgrading to the latest versions of Selenium's various components and your browser's webdriver? – ChrisGPT was on strike Sep 19 '17 at 15:04
  • So far to avoid the whole issue I have downgraded to the SeleniumGrid in Jenkins to 2.53.1 (from 3.1.0, it seems that 3.5.3 is not yet available as plugin) like some people have suggested. But in the end I would prefer to use the new code. I will make an experiment today with a selenium hub and node managed outside of Jenkins to see if the issue will occur or not. – glamredhel Sep 20 '17 at 07:33
  • The experiment with a setup of '3.5.3 selenium hub' + '3.5.3 selenium node' started from the commandline indeed worked - the issue is fixed as you wrote @Chris. I've managed to confirm that it is the usage of '3.1.0 selenium hub' that constitutes the problem. So: 1. Either downgrade the HUB to 2.53.1 (and then consequently the Nodes to 2.53.1 as well) => then Jenkins can be used... OR 2. Upgrade HUB to 3.5.3 (then also 2.53.1 may be used as nodes) => but you have to manage them via CMD. Then no code-juggling is needed in the first place. – glamredhel Sep 20 '17 at 09:44

0 Answers0