How To Get Text Of An Element In Selenium?

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • NodeJs-Cucumber-Selenium

    Run test automation on cloud with Cucumber.js and LambdaTest. This is a sample repo to help you execute Cucumber.js framework based test scripts in parallel with LambdaTest automation testing cloud

  • package getText; import java.net.MalformedURLException; import java.net.URL; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class TestClass { public String username = "YOUR_USERNAME"; public String accesskey = "YOUR_ACCESS_KEY"; public static RemoteWebDriver driver = null; public String gridURL = "@hub.lambdatest.com/wd/hub"; boolean status = false; @BeforeTest public void setUp(){ //You need to set desired capabilities which you can generate from Capability Generator from Lambda Test as per your requirements DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("browserName", "chrome"); capabilities.setCapability("version", "81.0"); capabilities.setCapability("platform", "win10"); // If this cap isn't specified, it will get any available one capabilities.setCapability("build", "LambdaTestProject"); capabilities.setCapability("name", "LambdaTestGetTextProject"); capabilities.setCapability("network", true); // Enables network logs capabilities.setCapability("visual", true); // Enables step by step screenshot capabilities.setCapability("video", true); // Enables video recording capabilities.setCapability("console", true); // Captures console logs try { driver = new RemoteWebDriver(new URL("https://" + username + ":" + accesskey + gridURL), capabilities); } catch (MalformedURLException e) { System.out.println("Invalid grid URL"); } catch (Exception e) { System.out.println(e.getMessage()); } } @Test public void testMethod(){ driver.get("https://www.lambdatest.com/"); driver.manage().window().maximize(); System.out.println("The title of the page is - "+driver.getTitle()); } @AfterTest public void tearDown(){ driver.quit(); } }

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts