0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

rSpec 複数のセレクターを所得して配列みたいに指定する

Posted at

前提

rSpec を使ってテストを書いている

本題

複数の同じクラスがあってその特定の要素を使用したいとき

find(".class")[0] 

みたいな書き方はできない

find メソッドは一意な要素しか所得しない

上みたいの書き方をしたかったら

page.all(".class")[0]

みたいにする

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?