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
-1
votes
1 answer

How to perform logic if findBy’Field’ does match?

I trying to do some logic if my inputed form email matches one found in the database. How do I make the comparison if the findBy’Field” returns the whole collection instead of just the field I want to compare to? I'd think it should be done without…
user6104636
  • 83
  • 1
  • 8
-2
votes
2 answers

Which webpage element is the proper one for Findelementby?

The highlighted code references the red search button with the magnifying glass to the right of the search box. I don't know which element to refer to it with Selenium webdriver FindBy. Can someone tell me the correct FindElementby and which…
-2
votes
1 answer

Using FindbyID method in Visual Studio

Having some issues using FindByID method in C#. The program will not recognize the FindBy method when written out as below. No other parts of the code produce an error. Database3DataSet.MemlistRow customerRow =…
-2
votes
3 answers

Selenium @FindBy linkText or @FindBy partialLinkText not working

I'm working for automation, I'm trying to click on an element ,this element has no id, classname so I'm using the xpath. To improve my code I would like to find this element by href, so I'm using: @FindBy(linkText="Transfer") WebElement…
Louloupi94
  • 13
  • 1
  • 2
-5
votes
4 answers

How to extract the text without id in selenium

  • Total Income

    £33,254.00
  • Taxable Income

joe
  • 34,529
  • 29
  • 100
  • 137
1 2 3
10
11