How can we select a text in Webpage using Selenium? I am trying to test one Web application using selenium webdriver.
I have defiend seperate methods in one class file for eg, 1) To Open an Browser 2) Select dropdown values 3) Switch to new window etc., will call the method where ever needed with that i want to create one method to select a text.
I would like to know how to achieve it instead of using the following Snippet, My codes are here:
Actions act_higlight = new Actions(driver);
act_higlight.moveToElement(element, 2, 15)
.clickAndHold()
.moveByOffset(30, 0)
.release()
.perform();
Because sometimes my text will be two lines sometime 5 lines, I am not suppose to touch my Method once it is declared ie., I cannot go and change this (.moveByOffset(30, 5)) frequently
So if any of you could guide me on this will be greatly appreciated. I have been stuck in this for quite few days now..
Just look at this screenshot this is how i want it.
Thanks in Advance.