This blog is a valuable resource for those seeking to expand their knowledge of software testing. It provides a wealth of information on various software testing concepts, as well as a comprehensive collection of interview questions and answers. If you are looking to enhance your skills and expertise in software testing, this blog is an excellent starting point for your learning journey.
Showing posts with label Parent Element Text. Show all posts
Showing posts with label Parent Element Text. Show all posts
Wednesday, April 14, 2021
How to get text from parent element and exclude text from children (C# Selenium)
Example: Suppose you have the following DOM
list = Application.driver.FindElements(By.XPath("//h2"));
string[] texts = new string[list.Count];
foreach (IWebElement element in list)
{
texts[i] = (string)((IJavaScriptExecutor)driver).ExecuteScript("return arguments[0].firstChild.textContent;", element);
i++;
}
return texts;
Labels:
How to get text from parent element and exclude text from children (C# Selenium),
Parent Element Text,
Selenium
Hi there! My name is Balaji G, and I am a full-time Automation Engineer. I possess more than 9 years of experience in Automation, API, Performance, and Functional Testing.
In my 9+ years of experience as an Automation Engineer, I have worked on a variety of projects across multiple industries including security, gaming, and e-commerce. I am proficient in a range of tools and technologies related to Automation, API, Performance, and Functional Testing, including Python, C#, Java, Selenium, Playwright, Appium, JMeter, Locust, REST API, Swagger, TestNG, NUnit, Gauge, BDD, Agile, and Postman, among others.
I am passionate about staying up-to-date with the latest developments in the field of software testing and I enjoy continuously learning and expanding my skillset. Over the years, I have gained extensive experience in test planning, test execution, test automation, and reporting, and have a proven track record of delivering high-quality software products.
Subscribe to:
Posts (Atom)
-
If you want to change the collation of the entire database, you can use the following command: ALTER DATABASE YourDatabaseName COLLATE NewCo...
-
Introduction: Katalon Studio is a free and complete automated testing tool for Web testing, Mobile testing and API testing. This tool ...
-
In this article, we see one of the most popular and widely used Selenium Reporting Tools (Extent Reports). What is Extent Reports? ...