Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 不推荐使用:类定位器定位具有字符串值的多个类;改用数组_Ruby_Cucumber_Watir Webdriver - Fatal编程技术网

Ruby 不推荐使用:类定位器定位具有字符串值的多个类;改用数组

Ruby 不推荐使用:类定位器定位具有字符串值的多个类;改用数组,ruby,cucumber,watir-webdriver,Ruby,Cucumber,Watir Webdriver,我正在使用Ruby和Cucumber Watir Webdriver框架进行自动化工作。 我更新了Ruby Gems并进行了捆绑安装。 然后我开始收到一条警告消息:“不推荐使用:类定位器来定位具有字符串值的多个类;改用数组” 修复此警告消息后,在我同事的一个系统上,将方括号中的类值替换为数组。 当我从Git中提取最新的代码并进行修复时,我开始收到一条错误消息:“TypeError:应该是[String,Regexp]中的一个,Get[“x-img xcp_image-cls xcpid_imag

我正在使用Ruby和Cucumber Watir Webdriver框架进行自动化工作。 我更新了Ruby Gems并进行了捆绑安装。 然后我开始收到一条警告消息:“不推荐使用:类定位器来定位具有字符串值的多个类;改用数组”

修复此警告消息后,在我同事的一个系统上,将方括号中的类值替换为数组。 当我从Git中提取最新的代码并进行修复时,我开始收到一条错误消息:“TypeError:应该是[String,Regexp]中的一个,Get[“x-img xcp_image-cls xcpid_image x-box-item x-img-default”]:Array”

我正在使用版本为“Ruby 2.2.6p396”的Ruby

我尝试了bundle安装和gem更新,但没有任何效果。 请指导如何解决此问题

My GemFile.lock内容:

宝石

远程:

规格:

archive-zip (0.7.0)

  io-like (~> 0.3.0)

builder (3.2.2)

childprocess (0.5.9)

  ffi (~> 1.0, >= 1.0.11)

chromedriver-helper (1.1.0)

  archive-zip (~> 0.7.0)

  nokogiri (~> 1.6)

cucumber (2.4.0)

  builder (>= 2.1.2)

  cucumber-core (~> 1.5.0)

  cucumber-wire (~> 0.0.1)

  diff-lcs (>= 1.1.3)

  gherkin (~> 4.0)

  multi_json (>= 1.7.5, < 2.0)

  multi_test (>= 0.1.2)

cucumber-core (1.5.0)

  gherkin (~> 4.0)

cucumber-wire (0.0.1)

data_magic (1.0)

  faker (>= 1.1.2)

  yml_reader (>= 0.6)

diff-lcs (1.2.5)

faker (1.7.1)

  i18n (~> 0.5)

ffi (1.9.14-x64-mingw32)

gherkin (4.0.0)

i18n (0.7.0)

io-like (0.3.0)

mini_portile2 (2.1.0)

multi_json (1.12.1)

multi_test (0.1.2)

net-http-persistent (2.9.4)

nokogiri (1.7.1-x64-mingw32)

  mini_portile2 (~> 2.1.0)

page-object (2.0.0)

  net-http-persistent (~> 2.9.4)

  page_navigation (>= 0.9)

  selenium-webdriver (~> 3.0)

  watir (~> 6.0)

page_navigation (0.10)

  data_magic (>= 0.22)

rake (12.0.0)

rspec (3.5.0)

  rspec-core (~> 3.5.0)

  rspec-expectations (~> 3.5.0)

  rspec-mocks (~> 3.5.0)

rspec-core (3.5.4)

  rspec-support (~> 3.5.0)

rspec-expectations (3.5.0)

  diff-lcs (>= 1.2.0, < 2.0)

  rspec-support (~> 3.5.0)

rspec-mocks (3.5.0)

  diff-lcs (>= 1.2.0, < 2.0)

  rspec-support (~> 3.5.0)

rspec-support (3.5.0)

rubyzip (1.2.0)

selenium-webdriver (3.3)

  childprocess (~> 0.5)

  rubyzip (~> 1.0)

  websocket (~> 1.0)

watir (6.0.3)

  selenium-webdriver (~> 3.3)

websocket (1.2.3)

yml_reader (0.7)
archive zip(0.7.0)
类io(~>0.3.0)
建造商(3.2.2)
子进程(0.5.9)
外国金融机构(~>1.0,>=1.0.11)
chromedriver辅助程序(1.1.0)
存档zip(~>0.7.0)
nokogiri(~>1.6)
黄瓜(2.4.0)
建造商(>=2.1.2)
黄瓜芯(~>1.5.0)
黄瓜丝(~>0.0.1)
差异lcs(>=1.1.3)
小黄瓜(~>4.0)
multi_json(>=1.7.5,<2.0)
多重检验(>=0.1.2)
黄瓜芯(1.5.0)
小黄瓜(~>4.0)
黄瓜丝(0.0.1)
数据魔法(1.0)
伪造者(>=1.1.2)
yml_读卡器(>=0.6)
差异lcs(1.2.5)
伪造者(1.7.1)
i18n(~>0.5)
外国金融机构(1.9.14-x64-W32)
小黄瓜(4.0.0)
i18n(0.7.0)
类io(0.3.0)
迷你端口2(2.1.0)
多线程json(1.12.1)
多重检验(0.1.2)
net http持久化(2.9.4)
nokogiri(1.7.1-x64-mingw32)
迷你端口2(~>2.1.0)
页面对象(2.0.0)
net http持久化(~>2.9.4)
页面导航(>=0.9)
selenium webdriver(~>3.0)
瓦特(~>6.0)
页面导航(0.10)
数据(大于等于0.22)
耙(12.0.0)
rspec(3.5.0)
rspec磁芯(~>3.5.0)
rspec期望值(~>3.5.0)
rspec模拟(~>3.5.0)
rspec核心(3.5.4)
rspec支持(~>3.5.0)
rspec期望值(3.5.0)
差异lcs(>=1.2.0,<2.0)
rspec支持(~>3.5.0)
rspec模拟(3.5.0)
差异lcs(>=1.2.0,<2.0)
rspec支持(~>3.5.0)
rspec支持(3.5.0)
rubyzip(1.2.0)
selenium webdriver(3.3)
子进程(~>0.5)
rubyzip(~>1.0)
websocket(~>1.0)
瓦蒂尔(6.0.3)
selenium webdriver(~>3.3)
websocket(1.2.3)
yml_读卡器(0.7)
平台

x64-W32

依赖关系

镀铬辅助器

黄瓜

数据魔法

页面对象

rspec

捆绑


1.13.7版本6.5中增加了通过多个类定位的功能。您的gem文件显示您仍在使用版本6.0.3。使用6.5之前的版本将导致您看到的
TypeError


您需要将您的Watir版本升级到6.5或更高版本。

嗨,Justin,谢谢您的回复。我会升级Watir gem并让你知道结果!非常感谢你的建议。我将Watir gem升级到6.6.3,并进行了捆绑升级。这解决了问题:)再次感谢:)