diff --git a/lib/capybara/selector/definition/frame.rb b/lib/capybara/selector/definition/frame.rb index 70649b40e..f5e26639d 100644 --- a/lib/capybara/selector/definition/frame.rb +++ b/lib/capybara/selector/definition/frame.rb @@ -5,7 +5,7 @@ xpath = XPath.descendant(:iframe).union(XPath.descendant(:frame)) unless locator.nil? locator_matchers = (XPath.attr(:id) == locator.to_s) | (XPath.attr(:name) == locator.to_s) - locator_matchers |= XPath.attr(test_id) == locator if test_id + locator_matchers |= XPath.attr(test_id) == locator.to_s if test_id xpath = xpath[locator_matchers] end xpath[find_by_attr(:name, name)] diff --git a/lib/capybara/selector/definition/label.rb b/lib/capybara/selector/definition/label.rb index ff6d764e2..bd3baff0d 100644 --- a/lib/capybara/selector/definition/label.rb +++ b/lib/capybara/selector/definition/label.rb @@ -6,7 +6,7 @@ xpath = XPath.descendant(:label) unless locator.nil? locator_matchers = XPath.string.n.is(locator.to_s) | (XPath.attr(:id) == locator.to_s) - locator_matchers |= XPath.attr(test_id) == locator if test_id + locator_matchers |= XPath.attr(test_id) == locator.to_s if test_id xpath = xpath[locator_matchers] end if options.key?(:for) diff --git a/lib/capybara/selector/definition/table.rb b/lib/capybara/selector/definition/table.rb index b93f4812f..d5d41888a 100644 --- a/lib/capybara/selector/definition/table.rb +++ b/lib/capybara/selector/definition/table.rb @@ -5,7 +5,7 @@ xpath = XPath.descendant(:table) unless locator.nil? locator_matchers = (XPath.attr(:id) == locator.to_s) | XPath.descendant(:caption).is(locator.to_s) - locator_matchers |= XPath.attr(test_id) == locator if test_id + locator_matchers |= XPath.attr(test_id) == locator.to_s if test_id xpath = xpath[locator_matchers] end xpath = xpath[XPath.descendant(:caption) == caption] if caption