Results 1 to 3 of 3
  1. #1

    webelement interface implementation

    Am trying to implement webelement interface.. but its not working... here z what am trying to do..

    public class MyWebElement implements WebElement
    // i'll implement all abstract methods of interface WebElement here

    it allowed me to do this annotation in my other class:

    @FindBy(xpath = "//textarea")
    public static MyWebElement testButton;

    But during execution i get this error

    Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.company.tests.StringTest.main(StringTest.java: 63)
    Caused by: java.lang.IllegalArgumentException: Can not set static com.company.pages.MyWebElement field com.company.pages.AccountServices.testButton to $Proxy4
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllega lArgumentException(Unknown Source)

  2. #2

    Re: webelement interface implementation

    @FindBy(xpath = "//textarea"), what does this return, does it return a webelement??

    @FindBy(xpath = "//textarea") WebElement myElement;

    Whay are you making a static reference here

    public static MyWebElement testButton
    Ganesh Iyer
    Winds of Change

  3. #3

    Re: webelement interface implementation

    It returns webelement..
    Reg static ref... am using it in another class... hence static.. It throws the same error even if it is not a static one.. Thanks!



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 04:14 PM.

Copyright BetaSoft Inc.