C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Locating Strategies- (By XPath- Using Multiple Attribute)In this section, you will learn how to locate a particular web element by XPath- Using Multiple Attribute. Let us consider an example in which we will try to locate the Google Search Engine Text box by XPath-Using Multiple Attribute. Follow the steps given below to locate the textbox provided on the home page of Google Search Engine.
The syntax for locating elements through XPath- Multiple Attribute can be written as: //<HTML tag>[@attribute_name1='attribute_value1'][@attribute_name2='attribute_value2] or //*[@attribute_name1='attribute_value1'][@attribute_name2='attribute_value2] Using XPath-Multiple, we can write the Java code along with the dynamic XPath location as: findElement(By.xpath("//*[@id=' lst-ib'][@class=' gsfi lst-d-f']"));
Next TopicLocating Strategies- By XPath
|