I've got a small shoes (3.3.3) program and a small ruby console program with selenium (3.4.4). If I open the selenium console program directly everything works fine, but if I want to open it via "exec("")" through shoes, it breaks and closes.
I thought the error is the webdriver, so I've written a simple console program with some easy "puts" output and shoes displays the console and the output.
The thing is... the selenium program worked yesterday and I can't find the problem, why it doesn't now.
The simplified shoes code looks like this:
Shoes.app(width: 200, height: 200, resizable: false){
button("GO", width: 200) do
exec('ruby data/test.rb')
end
}
Here comes the simple selenium-webdriver code named "test.rb":
require 'selenium-webdriver'
Selenium::WebDriver::PhantomJS.driver_path =
"driver/phantomjs/bin/phantomjs.exe"
browser = Selenium::WebDriver.for :phantomjs
wait = Selenium::WebDriver::Wait.new(:timeout => 15)
browser.navigate.to
"http://www.accuweather.com/de/de/heinsberg/52525/weather-forecast/174475"
wetterElement = browser.find_element(:id, "wrap-forecast-feed")
@wetterData = wetterElement.text.gsub(/\n/, ',').split(",")
puts @wetterData[1]
gets.chomp
Shoes gives me the following error message for a few msecs before it breaks:
So I looked it up, and found this code snippet:
def assert_file(path)
return if File.file? path
raise Error::WebDriverError, "not a file: #{path.inspect}"
end
def assert_executable(path)
assert_file(path)
return if File.executable? path
raise Error::WebDriverError, "not executable: #{path.inspect}"
end
I really have no idea... Thank you in advance.
Got it ... The folder with the shoes app was UTF-8 formatted. Simply changed the name and it worked.