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

Hi can anyone suggest me what type of non technical questions asked in interview for experienced people, I am trying to get job with fake experience can anyone help me please

908


What are the junits annotation linked with selenium?

485


How will u write page object models and data driven model.

823


What are the challenges with selenium ide?

559


Write the code to double click an element in selenium?

473






How can we handle pop-ups in rc?

520


What selenium components do you know?

477


Explain what is datadriven framework and keyword driven?

479


How can we fetch the page source in selenium?

535


How recorded command can be edited in ide?

525


What’s selenese?

457


What is the use of get options () method?

530


Explain what is the main difference between web-driver and rc?

462


How to perform right click using webdriver?

520


What are the main advantages of selenium grid?

503