Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97799

How to select complete line of paragraph with mouse by using offset or drag/drop?

$
0
0

I want to select this text line with mouse:

Today is the age of education we cannot neglect the importance of science an Technology.

To achieve this I am using below code but it starts selecting from middle, I want to select from first word till the end.

    IWebElement iscop = driver.FindElement(By.XPath("//*[@id='idRequirement']/div/span[1]/p"));//find element

    string text = driver.FindElement(By.XPath("//*[@id='idRequirement']/div/span[1]/p")).Text;//get element text

        Actions actions = new Actions(driver);
       int length = text.Length;
        actions.DragAndDropToOffset(iscop, 75, 0);

        actions.ClickAndHold(iscop);
        actions.MoveByOffset(75, 0);
        actions.Release(iscop);
        actions.Build().Perform();

Viewing all articles
Browse latest Browse all 97799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>