简体   繁体   English

为什么我的 ruby​​ watir Cucumber 框架的步骤文件中出现此错误

[英]Why am I getting this error in my step file of my ruby watir cucumber framework

I'm building my first automation framework with Ruby, Watir and cucumber now I'm getting this error on the step file and I can't tell why.我正在用 Ruby、Watir 和 Cucumber 构建我的第一个自动化框架,现在我在 step 文件中遇到了这个错误,我不知道为什么。

enter image description here在此处输入图片说明

First off, never give the image here, people can't take your code and execute it to check what went wrong.首先,永远不要在此处提供图像,人们无法获取您的代码并执行它来检查出了什么问题。

And your problem is,而你的问题是,

@browser.a(text: 'click here').click

a() receives the hash as the parameter, first one should be the symbol(it's the key of the hash) and second one has to be the string here(it's the value of the hash), So please enclose the second parameter in Quotes. a()接收散列作为参数,第一个应该是符号(它是散列的键),第二个必须是这里的字符串(它是散列的值),所以请将第二个参数括在引号中. It would work.它会工作。 = symbol in front of the second parameter is not necessary. =在第二个参数前面的符号不是必需的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我在错误消息中看到Selenium Web驱动程序虽然我使用的是Watir webdriver? - Why am I seeing Selenium web driver in my error message though I am using Watir webdriver? 为什么我无法在Ruby中加载文件? - Why am I unable to load my file in Ruby? 我正在为watir脚本创建日志文件,但收到错误消息 - I am creating log file for watir script but I am getting error message 为什么我在heroku上却出现此错误,而在我的Rails应用程序中却没有开发此错误? - Why am I getting this error on heroku but not in development in my rails app? 为什么在 Ruby 中进行简单的矩阵加法运算时出现“无方法”错误? 我的其他程序中有许多基本相同的行 - Why am I getting a “no method” error for a simple matrix add operation in Ruby? Many essentially identical lines in my other programs 为什么我的RoR应用程序出现此错误? - Why am I getting this error with my RoR app? 为什么我的 ruby​​ 代码会收到错误消息? - Why is my ruby code getting error messages? 为什么在使用.to_hash时从我的Ruby对象中获得两组不同的值? - Why am I getting two different sets of values from my Ruby object when using .to_hash? Ruby出现未定义的方法错误,我不确定我是否完全了解方法如何为我的插件工作 - Ruby getting undefined Method error, and i am not sure if i fully understand how methods are working for my plugin 为什么我的Ruby代码中出现“错误的参数数量(0 for 2)”异常? - Why am I getting a “wrong number of arguments (0 for 2)” exception in my Ruby Code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM