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 can we create object repository in selenium?

498


Can we edit recorded selenium ide test cases?

493


List some of the test types that are supported by selenium.

462


How recorded command can be edited in ide?

511


Tell me could cookies be deleted in selenium?

476






How can we clear a text written in a textbox?

519


What happen if you mix both implicit wait and explicit wait in a selenium script?

459


what are the testing frameworks used in selenium?

520


What is selenium 1.0?

479


What is exception test in selenium?

554


If one wanted to display the value of a variable named answer in the log file, what would the first argument to the previous command look like?

478


What are the advantages of page object model framework?

457


Why to choose python over java in selenium?

517


Do you know how to debug the tests in selenium ide?

457


What is the reason to use the selenium grid?

565