搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

lock file not removed, which breaks selenium-webdriver

  • 無回覆
  • 1 有這個問題
  • 50 次檢視
more options

It seems that as of 79.0 the `lock` file in profile dir is no longer removed at browser close. That doesn't play very nicely with selenium driver (ruby API) when I want to create a browser instance with existing profile name. It seems that profile directory is copied, but this fails for `lock` file, as it cannot be `stat`ed.

Is not removing `lock` file intended?

This can be reproduced with: ruby -r 'selenium-webdriver' -e 'Selenium::WebDriver.for :firefox, profile: "my_existing_profile_name"'

which gives the stacktrace: /usr/local/lib/ruby/gems/2.6/gems/rubyzip-2.3.0/lib/zip/entry.rb:409:in `stat': No such file or directory @ rb_file_s_stat - /mnt/work/webdriver-rb-profilecopy20200726-75146-9bn20t/lock (Errno::ENOENT) from /usr/local/lib/ruby/gems/2.6/gems/rubyzip-2.3.0/lib/zip/entry.rb:409:in `file_stat' from /usr/local/lib/ruby/gems/2.6/gems/rubyzip-2.3.0/lib/zip/entry.rb:551:in `gather_fileinfo_from_srcpath' from /usr/local/lib/ruby/gems/2.6/gems/rubyzip-2.3.0/lib/zip/file.rb:303:in `add' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/zipper.rb:92:in `add_zip_entry' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/zipper.rb:55:in `block (2 levels) in zip' from /usr/local/lib/ruby/2.6/find.rb:49:in `block (2 levels) in find' from /usr/local/lib/ruby/2.6/find.rb:48:in `catch' from /usr/local/lib/ruby/2.6/find.rb:48:in `block in find' from /usr/local/lib/ruby/2.6/find.rb:43:in `each' from /usr/local/lib/ruby/2.6/find.rb:43:in `find' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/zipper.rb:54:in `block in zip' from /usr/local/lib/ruby/gems/2.6/gems/rubyzip-2.3.0/lib/zip/file.rb:125:in `open' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/zipper.rb:81:in `with_tmp_zip' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/zipper.rb:53:in `zip' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox/profile.rb:193:in `encoded' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox/options.rb:136:in `as_json' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox/marionette/driver.rb:81:in `create_capabilities' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox/marionette/driver.rb:36:in `initialize' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox/driver.rb:33:in `new' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox/driver.rb:33:in `new' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/driver.rb:54:in `for' from /usr/local/lib/ruby/gems/2.6/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver.rb:88:in `for' from -e:1:in `<main>' 2020-07-26 21:58:10 WARN Selenium [DEPRECATION] :profile is deprecated. Use Selenium::WebDriver::Firefox::Options#profile= instead.


  1. ruby --version

ruby 2.6.6p146 (2020-03-31 revision 67876) [amd64-freebsd11]

  1. gem list selenium-webdriver

selenium-webdriver (3.142.7)