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

How to change the url on a webpage using selenium web driver?

480


In which format does source view shows your script in selenium ide?

938


We do create a reference variable ‘driver’ of type webdriver

488


Do you know how to locate a link using its text in selenium?

481


Explain how you can use recovery scenario with selenium?

477






What are core extension?

501


How can we find the value of different attributes like name, class, value of an element?

502


What is parameterization in testng?

492


When do you use selenium grid?

508


What are the testing type supported by selenium webdriver?

505


Explain the difference between confirming and verifying commands?

549


What are the different ways in which selenium ide can be opened?

461


What are the types of assertions there in selenium?

487


Write a code to wait for a particular element to be visible on a page. Write a code to wait for an alert to appear.

762


What are some commonly encountered exceptions in selenium?

530