crystal-loot / selenium.cr

Selenium library for Crystal
https://crystal-loot.github.io/selenium.cr/
MIT License
24 stars 7 forks source link

Find new port if already taken #21

Closed matthewmcgarvey closed 1 year ago

matthewmcgarvey commented 2 years ago

Related to #20

In LuckyFlow we're working towards allowing the registration of drivers. Two drivers are going to be chrome and chrome headless. If you try to run your specs with a mix of the two, when it gets to the end of the specs you get an error when it tries to close the second driver because the first already closed the process (see related issue). The problem is that they shouldn't be sharing a process. If you use 50 different registered drivers all connecting to chrome, it should use 50 different chrome processes.

Selenium ruby library has a PortProber and we should look into adding something similar https://github.com/SeleniumHQ/selenium/blob/trunk/rb/lib/selenium/webdriver/common/port_prober.rb

Dakad commented 1 year ago

Hey Matthew :wave: I'm going to tackle this issue. I need this fix to move on with a project. I'm quite a noob to Selenium architecture. I checked the link you posted for the PortProber and how it's used in the service_manager.rb: https://github.com/SeleniumHQ/selenium/blob/a6d74f9569b29b5358f13747947f155db93a64b4/rb/lib/selenium/webdriver/common/service_manager.rb#L106

Do you have any new info or suggestions?

matthewmcgarvey commented 1 year ago

No, I don't have anything new. Thanks for picking this up, and let me know if you need any help 👍