0

I define radioButton that there. It work if I initialize element that there But it doesn't work with @FindBy annotation. I create a constructor:

public MyRadioButtons(By optionsNamesLocatorTemplate) {
    super(optionsNamesLocatorTemplate);
    //some code
}

When I run tests, I have an error:

java.lang.AssertionError: Error in getElementInstance for field

How to define them using JDI style and approach?

1 Answers1

0

Because you are returning a MyRadioButtons Object, not WebElement Object. Try this code :

WebElement radioButton = driver.findElement(optionsNamesLocatorTemplate);
Hamza Torjmen
  • 250
  • 1
  • 2
  • 10
  • Thank you, but 1. RadioButtons - collections of elements. 2. I use JDI. I know as it doing on nativ Selenium. Need example in this framework. – Anton Karpenko Jul 19 '18 at 17:53