TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

WebDriver Locating Strategies By XPath Using text()

WebDriver Locating Strategies By XPath Using text() with Introduction, features, selenium basic terminology, what is selenium, selenium limitations, selenium vs qtp, tool suite, selenium ide, ide-installation, ide-features, ide-first test case, ide-commands, ide-creating test cases manually, ide-login test etc.

<< Back to WEBDRIVER

Locating Strategies- (By XPath- Using text())

In this section, you will learn how to locate a particular web element by XPath- Using text() method.

"text() method" is used to identify an element based on the text available on the web page.

Let us consider an example in which we will try to locate the text "Google offered in" on the default page of Google Search engine.

Locating Strategies- By XPath- Using text()

The syntax for locating elements through XPath- Using text() method can be written as:

//*[text()='Google offered in'] 

Using XPath- text() method, we can write the Java code along with the dynamic XPath location as:

findElement(By.xpath("//*[text()='Google offered in')]"));





Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf