WebDriver-Support for IsTextPresent in Selenium IDE 1.1.0

1,027 views
Skip to first unread message

Thomas Bartz

unread,
Jul 18, 2011, 10:30:54 AM7/18/11
to selenium-...@googlegroups.com
Hello,

there is no equivalent selenium.IsTextPresent() in the webdriver API as far as I know, so when exporting a testcase from IDE to file, instead of the according IsTextPresent-command I get an error message like:

// ERROR: Caught exception [ERROR: Unsupported command [isTextPresent]]

Are there any plans to enhance webdriver for content checking? Would be very much apprechiated. I bet everyone using webdriver has a hacked his own method for isTextPresent().

Regards,
Thomas Bartz

Moises Siles

unread,
Jul 18, 2011, 10:56:20 AM7/18/11
to selenium-...@googlegroups.com
I think you have to implement it,

for example 

webDriver.FindElement(By.Id("myID")).Text.Contains("MyText");



--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-developers/-/3MEOw0ehrv4J.
To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.

Samit

unread,
Jul 18, 2011, 12:07:11 PM7/18/11
to Selenium Developers
Hi Thomas,

Please take a look at this. http://blog.reallysimplethoughts.com/2011/07/08/selenium-ide-and-selenium-2-webdriver/

isTextPresent will make it in the next update of the Webdriver
Formatters. It would be nice if you add a comment to
http://code.google.com/p/selenium/issues/detail?id=2003

Cheers,
Samit

On Jul 18, 4:56 pm, Moises Siles <moises.si...@gmail.com> wrote:
> I think you have to implement it,
>
> for example
>
> webDriver.FindElement(By.Id("myID")).Text.Contains("MyText");
>

Thomas Bartz

unread,
Jul 19, 2011, 7:58:21 AM7/19/11
to selenium-...@googlegroups.com
Hi Samit,

thanks for the info and thanks for considering my feedback. I did leave a comment on the issue 2003 as you wished.

Regards,
Thomas

Mark Collin

unread,
Jul 20, 2011, 4:42:32 AM7/20/11
to selenium-...@googlegroups.com

This will do the same thing:

 

driver.findElement(By.xpath(“//*[contains(.,’<myTextHere>’)]”));

--

You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-developers/-/3MEOw0ehrv4J.
To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.


-- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error please notify postm...@ardescosolutions.com
Reply all
Reply to author
Forward
0 new messages