私はルビーが初めてです。私は私のwatirスクリプトのためのヘルパーメソッドファイルを作成しました。helper_methodファイルを開くときに以下のエラー[無効なブレーク(SyntaxError)]が表示される
require "C:/Sites/common/helper_methods"
をし、このエラーメッセージがスローされます:私は、スクリプトを実行しようとすると、それは、この行を打つ
C:/Sites/common/helper_methods.rb: C:/Sites/common/helper_methods.rb:1387: Invalid break (SyntaxError)
はので、私はエラーが何を意味するのかわかりません。
私は答えを探しましたが、メッセージを理解するのに役立つものは見つかりませんでした。
ご協力いただければ幸いです。
ジョー
こんにちはポール、
ここが1387 1387
後の方法に問題かもしれません
#Write Subject Lines to file
def add_subject_line_to_file(s)
project_path = Dir.pwd
fileNamePath = File.join(project_path,'data_files','multi_add_discussion_files','multi_add_discussion_headers.txt')
#Writing to new file
open(fileNamePath,'a+'){ |f|
f << "#{s}\n"
}
end
前方法であり、
#The following method will validate text at on the page not in a specific location
def text_validation(rt)
#Validate comment displays
if @browser.text.include? rt
#Response
response = "PASS!!! The following user comment was found [ #{rt} ]."
write_to_file(response)
else
#Response
response = "FAIL!!! The following user comment was NOT found [ #{rt} ]."
write_to_file(response)
end #End of Validate comment displays
end