Suppose I have stored WebElment in LoginPage.java class as shown below.
@FindBy(xpath="//input[@name='user_name']") WebElement username;
Now from my test file say VerifyLogin.java I want to access xpath of username which is stored in above LoginPage.java file something like this
LoginPage loginPage = PageFactory.initElements(driver, LoginPage.class);
loginPage.username;//then it should return the xpath //input[@name='user_name']
I know the above approach is wrong, but is there any way to get only the xpath that was stored in LoginPage file that I can use in VerifyLogin file?