Questions tagged [findby]

FindBy is a type of annotation used to mark a field on a Page Object to indicate an alternative mechanism for locating the element or a list of elements. Used in conjunction with PageFactory this allows users to quickly and easily create PageObjects.

FindBy is a type of annotation used to mark a field on a Page Object to indicate an alternative mechanism for locating the element or a list of elements. Used in conjunction with PageFactory this allows users to quickly and easily create PageObjects.

You can either use this annotation by specifying both "how" and "using" or by specifying one of the location strategies (eg: "id") with an appropriate value to use. Both options will delegate down to the matching By methods in By class.

For example, these two annotations point to the same element:

@FindBy(id = "foobar") WebElement foobar;
@FindBy(how = How.ID, using = "foobar") WebElement foobar;

and these two annotations point to the same list of elements:

@FindBy(tagName = "a") List<WebElement> links;
@FindBy(how = How.TAG_NAME, using = "a") List<WebElement> links;
155 questions
0
votes
2 answers

Grails findByName Regex

I have a domain-class called option. There is an attribute called name. The names are like: abc.1 abc.2 xxx.1 xxx.2 xxx.3 I want all options that start with abc. Normally I use Options.findByName("xyz") But i want all that start with abc. So in…
user2244536
  • 67
  • 2
  • 10
0
votes
4 answers

Is it possible to search for a dynamic button if the beginning of he ID is always the same?

I am using Selenium in some automation testing. On a certain page i need to click a button. This same page is used multiple times and when i originally tried to use the full xpath it would work on one of the pages but not the other. The full xpath…
user3205214
  • 65
  • 1
  • 7
0
votes
3 answers

Error ListView in findViewById

The class is an extension of another class and is experiencing an error when I mess with the listview. Can anyone help me? Layout: GridLayout XML:
Suh
  • 5
  • 2
0
votes
1 answer

How to delete objects through a named scope?

There is a join table with three columns: id, product_a_id, product_b_id class ProductConnection < ActiveRecord::Base belongs_to :product_a, class_name: :Product belongs_to :product_b, class_name: :Product end I would like to filter the…
JJD
  • 50,076
  • 60
  • 203
  • 339
0
votes
2 answers

Find latest entries in a list based on a field

I'm not even sure how to search if this is an existing questions. Let me just give an example: Call Instance Date Created Resource Resource Status ------------------------------------------------------------------ 6557 …
Charles Wood
  • 864
  • 8
  • 23
0
votes
1 answer

find_by_* method is not returning the object

I am trying to set up a simple authentication for my rails application. I have a security_users scaffold and have created some users. When, I am trying to log in using some of these accounts it seams that the "find_by_*" method is not able to…
gotqn
  • 42,737
  • 46
  • 157
  • 243
0
votes
2 answers

Extracting object's actual value knowing its' ID in Grails

I am trying to create a new Project instance (the code is given below), but the constraints don't allow me to do that, because instead of seeing names, the project generates id's. For example, instead of 'On target'(name) it gets '3'(id of 'On…
0
votes
1 answer

How to use @FindBy annotation in Selenium WebDriver

I want to know what wrong with my code, because when I try to test my code, I didn´t get anything. public class SeleniumTest { private WebDriver driver; private String nome; private String idade; @FindBy(id = "j_idt5:nome") private WebElement…
Diego Macario
  • 1,240
  • 2
  • 21
  • 33
0
votes
1 answer

Doctrine one-to-many situation: how to easily fetch related entities

To simplify, two entities are defined: User and Comment. User can post many comments and every comment has only one user assigned, thus Comment entity has: /** * @var \Frontuser * * @ORM\ManyToOne(targetEntity="Frontuser") * @ORM\JoinColumns({ …
user2311163
  • 3
  • 1
  • 4
0
votes
1 answer

Zend Navigation Find Page and Render Menu with its Subpages

I am putting together a Zend Navigation for a site with 4 different levels of access: Guest, Member1, Member2, and Admin. My navigation XML looks something like this:
sbay
  • 435
  • 1
  • 7
  • 20
0
votes
1 answer

Couchdb finder using CouchRest

I just want to know how can I build a find_all_by_action_and_author_id method in Rails with while using the couchdb. My Model looks like this: class Activity < CouchRest::Model::Base property :action, String property :author_id,…
Hannes
  • 2,451
  • 2
  • 18
  • 11
0
votes
2 answers

howto find_by ownkey the exact entry in rails

we have an show-action which should find by the own_key the right entry. The own_key is generated as UUIDTools::UUID.timestamp_create().to_s. The following question is now here. class ListController < ApplicationController respond_to :html, :xml,…
amarradi
  • 109
  • 3
  • 16
0
votes
1 answer

Grails FindBy* with an inteface property

I have a class like class Account { BigDecimal balance = 0 SortedSet transactions AccountOwner owner static constraints = { } static hasMany = [transactions:Transaction] } when I try to query the Account like def…
-1
votes
2 answers

Please, suggest custom findBy or query

I need to do a search by several parameters, but if some of them are null don't take them into account when searching. For example, I want to find a person who is in the USA and works in Google, but now my search is implemented so that there are all…
BFST
  • 72
  • 6
-1
votes
1 answer

How tell JAVA Selenium WebDriver to find to text-element from html

There are more than one span elements on my html and I want to click Apple but there is a problem that this list have same class and no id. How can I get Apple with @FindBy Apple
user6941415
1 2 3
10
11