How can we get text from a Web Part?

Answer Posted / uma rani

We can use getText() pre-defined method. It helps to retrieve the text of a specific web element.

String text = driver.findElement(By.id("xxxx")).getText();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different Selenium components?

512


How to find more than one web element in the list?

469


What is the purpose of creating a reference variable- 'driver' of type webdriver instead of directly creating a firefoxdriver object or any other driver's reference in the statement webdriver driver = new firefoxdriver();?

511


Tell us what kinds of test types are supported by selenium?

468


How to pause a test execution for 5 seconds at a specific point?

523






How to debug the tests in selenium ide?

524


What is a relative xpath?

504


What is listeners in selenium webdriver?

549


What you say in regards to the flexibility of selenium test suite?

503


What is selenium 3.0?

488


Tell me could cookies be deleted in selenium?

474


How to insert a start point in selenium ide?

488


How do perform drag and drop using webdriver?

514


How you can use “submit” a form using selenium?

512


How to scroll web page down or up using selenium webdriver?

472