Skip to main content
added some more information
Source Link

This will work on c#.

        driver.FindElement(By.CssSelector("body")).SendKeys(OpenQA.Selenium.Keys.Control + "a");
        driver.FindElement(By.CssSelector("body")).SendKeys(OpenQA.Selenium.Keys.Control + "c");
        var txt = Clipboard.GetText();

I like this better then GetText()driver.FindElement(By.CssSelector("body")).Text, because gettextText returns all kinds of extra chars, this returns clean text. Works especialy well with tables returning tab delimted rows that can easily be pasted into excel.

This will work on c#.

        driver.FindElement(By.CssSelector("body")).SendKeys(OpenQA.Selenium.Keys.Control + "a");
        driver.FindElement(By.CssSelector("body")).SendKeys(OpenQA.Selenium.Keys.Control + "c");
        var txt = Clipboard.GetText();

I like this better then GetText(), because gettext returns all kinds of extra chars, this returns clean text.

This will work on c#.

        driver.FindElement(By.CssSelector("body")).SendKeys(OpenQA.Selenium.Keys.Control + "a");
        driver.FindElement(By.CssSelector("body")).SendKeys(OpenQA.Selenium.Keys.Control + "c");
        var txt = Clipboard.GetText();

I like this better then driver.FindElement(By.CssSelector("body")).Text, because Text returns all kinds of extra chars, this returns clean text. Works especialy well with tables returning tab delimted rows that can easily be pasted into excel.

Source Link

This will work on c#.

        driver.FindElement(By.CssSelector("body")).SendKeys(OpenQA.Selenium.Keys.Control + "a");
        driver.FindElement(By.CssSelector("body")).SendKeys(OpenQA.Selenium.Keys.Control + "c");
        var txt = Clipboard.GetText();

I like this better then GetText(), because gettext returns all kinds of extra chars, this returns clean text.