Package org.jenkinsci.test.acceptance
Class ByFactory
- java.lang.Object
-
- org.jenkinsci.test.acceptance.ByFactory
-
public class ByFactory extends Object
More factories forBy
objects.To make the code flow, instantiate this object in the variable named "by"
Mainly from Capybara's "selector.rb". To obtain the actual evaluation, I run "bundle exec irb" from selenium-tests, then "require 'xpath'", and just evaluate XPath::HTML.radio_button("XXX").
- Author:
- Kohsuke Kawaguchi
- See Also:
CapybaraPortingLayer.by
-
-
Constructor Summary
Constructors Constructor Description ByFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openqa.selenium.By
action(String path, Object... args)
org.openqa.selenium.By
ancestor(String tagName)
org.openqa.selenium.By
areaPath(String pathPrefix)
"/foo/bar" matches div elements with path attribute "/foo/bar" or "/foo/bar[n]".org.openqa.selenium.By
button(String locator)
Finds a buttonorg.openqa.selenium.By
checkbox(String locator)
Finds checkbox.org.openqa.selenium.By
css(String css, Object... args)
org.openqa.selenium.By
href(String locator)
Link href selector.org.openqa.selenium.By
id(String s)
org.openqa.selenium.By
input(String locator)
Finds input fields.org.openqa.selenium.By
link(String locator)
Capybara's :link selector.org.openqa.selenium.By
name(String name, Object... args)
org.openqa.selenium.By
option(String name)
org.openqa.selenium.By
parent()
org.openqa.selenium.By
partialLinkText(String linkText)
org.openqa.selenium.By
path(String path, Object... args)
Returns the "path" selector that finds an element by following the form-element-path plugin.org.openqa.selenium.By
radioButton(String locator)
Select radio button by its label text.org.openqa.selenium.By
tagName(String name)
org.openqa.selenium.By
url(String path, Object... args)
org.openqa.selenium.By
xpath(String xpath)
org.openqa.selenium.By
xpath(String format, Object... args)
Construct XPath inserting placeholders using String.format.
-
-
-
Method Detail
-
xpath
public org.openqa.selenium.By xpath(String xpath)
-
xpath
public org.openqa.selenium.By xpath(String format, Object... args)
Construct XPath inserting placeholders using String.format.- Parameters:
format
- Format specifier for xpath. Only string placeholders are supported - do not put quotes around them.
-
path
public org.openqa.selenium.By path(String path, Object... args)
Returns the "path" selector that finds an element by following the form-element-path plugin.
-
link
public org.openqa.selenium.By link(String locator)
Capybara's :link selector.- Parameters:
locator
- Text, id, title, or image alt attribute of the link
-
href
public org.openqa.selenium.By href(String locator)
Link href selector.- Parameters:
locator
- href of the link
-
checkbox
public org.openqa.selenium.By checkbox(String locator)
Finds checkbox.- Parameters:
locator
- Text
-
radioButton
public org.openqa.selenium.By radioButton(String locator)
Select radio button by its label text.
-
input
public org.openqa.selenium.By input(String locator)
Finds input fields.- Parameters:
locator
- Text, id, title.
-
button
public org.openqa.selenium.By button(String locator)
Finds a button
-
tagName
public org.openqa.selenium.By tagName(String name)
-
option
public org.openqa.selenium.By option(String name)
-
id
public org.openqa.selenium.By id(String s)
-
parent
public org.openqa.selenium.By parent()
-
ancestor
public org.openqa.selenium.By ancestor(String tagName)
-
areaPath
public org.openqa.selenium.By areaPath(String pathPrefix)
"/foo/bar" matches div elements with path attribute "/foo/bar" or "/foo/bar[n]". Does not match "/foo/bar/baz" or "/foo/bar[1]/baz".
-
partialLinkText
public org.openqa.selenium.By partialLinkText(String linkText)
- Parameters:
linkText
- The text to match against- Returns:
- a By which locates A elements that contain the given link text
-
-