diff --git a/examples/python/tests/elements/test_locators.py b/examples/python/tests/elements/test_locators.py index 53b695b6fc8..3622b70d97f 100644 --- a/examples/python/tests/elements/test_locators.py +++ b/examples/python/tests/elements/test_locators.py @@ -1,2 +1,84 @@ +import pytest from selenium import webdriver +from selenium.webdriver.common.by import By + +def test_class_name(): + driver = webdriver.Chrome() + driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") + element = driver.find_element(By.CLASS_NAME, "information") + + assert element is not None + assert element.tag_name == "input" + + driver.quit() + +def test_css_selector(driver): + driver = webdriver.Chrome() + driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") + element = driver.find_element(By.CSS_SELECTOR, "#fname") + + assert element is not None + assert element.get_attribute("value") == "Jane" + + driver.quit() + +def test_id(driver): + driver = webdriver.Chrome() + driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") + element = driver.find_element(By.ID, "lname") + + assert element is not None + assert element.get_attribute("value") == "Doe" + + driver.quit() + +def test_name(driver): + driver = webdriver.Chrome() + driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") + element = driver.find_element(By.NAME, "newsletter") + + assert element is not None + assert element.tag_name == "input" + + driver.quit() + +def test_link_text(driver): + driver = webdriver.Chrome() + driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") + element = driver.find_element(By.LINK_TEXT, "Selenium Official Page") + + assert element is not None + assert element.get_attribute("href") == "https://www.selenium.dev/" + + driver.quit() + +def test_partial_link_text(driver): + driver = webdriver.Chrome() + driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") + element = driver.find_element(By.PARTIAL_LINK_TEXT, "Official Page") + + assert element is not None + assert element.get_attribute("href") == "https://www.selenium.dev/" + + driver.quit() + +def test_tag_name(driver): + driver = webdriver.Chrome() + driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") + element = driver.find_element(By.TAG_NAME, "a") + + assert element is not None + assert element.get_attribute("href") == "https://www.selenium.dev/" + + driver.quit() + +def test_xpath(driver): + driver = webdriver.Chrome() + driver.get("https://www.selenium.dev/selenium/web/locators_tests/locators.html") + element = driver.find_element(By.XPATH, "//input[@value='f']") + + assert element is not None + assert element.get_attribute("type") == "radio" + + driver.quit() diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.en.md b/website_and_docs/content/documentation/webdriver/elements/locators.en.md index d08963fd063..865c2910f9f 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.en.md @@ -49,7 +49,7 @@ page. To understand and create locator we will use the following HTML snippet.

Contact Selenium

-
+ Male   Female

@@ -80,10 +80,9 @@ available in Selenium. WebDriver driver = new ChromeDriver(); driver.findElement(By.className("information")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.CLASS_NAME, "information") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L7-L9" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.ClassName("information")); @@ -114,10 +113,9 @@ textbox, using css. WebDriver driver = new ChromeDriver(); driver.findElement(By.cssSelector("#fname")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.CSS_SELECTOR, "#fname") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L17-L19" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.CssSelector("#fname")); @@ -146,10 +144,9 @@ We will identify the Last Name field using it. WebDriver driver = new ChromeDriver(); driver.findElement(By.id("lname")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.ID, "lname") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L27-L29" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Id("lname")); @@ -179,10 +176,9 @@ We will identify the Newsletter checkbox using it. WebDriver driver = new ChromeDriver(); driver.findElement(By.name("newsletter")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.NAME, "newsletter") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L37-L39" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Name("newsletter")); @@ -210,10 +206,9 @@ In the HTML snippet shared, we have a link available, let's see how will we loca WebDriver driver = new ChromeDriver(); driver.findElement(By.linkText("Selenium Official Page")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.LINK_TEXT, "Selenium Official Page") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L47-L49" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.LinkText("Selenium Official Page")); @@ -242,10 +237,9 @@ In the HTML snippet shared, we have a link available, lets see how will we locat WebDriver driver = new ChromeDriver(); driver.findElement(By.partialLinkText("Official Page")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.PARTIAL_LINK_TEXT, "Official Page") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L57-L59" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.PartialLinkText("Official Page")); @@ -272,10 +266,9 @@ From the above HTML snippet shared, lets identify the link, using its html tag " WebDriver driver = new ChromeDriver(); driver.findElement(By.tagName("a")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.TAG_NAME, "a") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L67-L69" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.TagName("a")); @@ -308,10 +301,9 @@ first name text box. Let us create locator for female radio button using xpath. WebDriver driver = new ChromeDriver(); driver.findElement(By.xpath("//input[@value='f']")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.XPATH, "//input[@value='f']") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L77-L79" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Xpath("//input[@value='f']")); diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.ja.md b/website_and_docs/content/documentation/webdriver/elements/locators.ja.md index 28b11bcd66c..f28ed13f85b 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.ja.md @@ -48,7 +48,7 @@ page. To understand and create locator we will use the following HTML snippet.

Contact Selenium

- + Male   Female

@@ -78,10 +78,9 @@ available in Selenium. WebDriver driver = new ChromeDriver(); driver.findElement(By.className("information")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.CLASS_NAME, "information") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L7-L9" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.ClassName("information")); @@ -111,10 +110,9 @@ textbox, using css. WebDriver driver = new ChromeDriver(); driver.findElement(By.cssSelector("#fname")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.CSS_SELECTOR, "#fname") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L17-L19" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.CssSelector("#fname")); @@ -142,10 +140,9 @@ We will identify the Last Name field using it. WebDriver driver = new ChromeDriver(); driver.findElement(By.id("lname")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.ID, "lname") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L27-L29" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Id("lname")); @@ -174,10 +171,9 @@ We will identify the Newsletter checkbox using it. WebDriver driver = new ChromeDriver(); driver.findElement(By.name("newsletter")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.NAME, "newsletter") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L37-L39" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Name("newsletter")); @@ -204,10 +200,9 @@ In the HTML snippet shared, we have a link available, lets see how will we locat WebDriver driver = new ChromeDriver(); driver.findElement(By.linkText("Selenium Official Page")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.LINK_TEXT, "Selenium Official Page") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L47-L49" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.LinkText("Selenium Official Page")); @@ -235,10 +230,9 @@ In the HTML snippet shared, we have a link available, lets see how will we locat WebDriver driver = new ChromeDriver(); driver.findElement(By.partialLinkText("Official Page")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.PARTIAL_LINK_TEXT, "Official Page") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L57-L59" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.PartialLinkText("Official Page")); @@ -264,10 +258,9 @@ From the above HTML snippet shared, lets identify the link, using its html tag " WebDriver driver = new ChromeDriver(); driver.findElement(By.tagName("a")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.TAG_NAME, "a") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L67-L69" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.TagName("a")); @@ -299,10 +292,9 @@ first name text box. Let us create locator for female radio button using xpath. WebDriver driver = new ChromeDriver(); driver.findElement(By.xpath("//input[@value='f']")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.XPATH, "//input[@value='f']") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L77-L79" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Xpath("//input[@value='f']")); diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md index de57a4812d3..f50ac162eff 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md @@ -51,7 +51,7 @@ page. To understand and create locator we will use the following HTML snippet.

Contact Selenium

- + Male   Female

@@ -81,10 +81,9 @@ available in Selenium. WebDriver driver = new ChromeDriver(); driver.findElement(By.className("information")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.CLASS_NAME, "information") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L7-L9" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.ClassName("information")); @@ -114,10 +113,9 @@ textbox, using css. WebDriver driver = new ChromeDriver(); driver.findElement(By.cssSelector("#fname")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.CSS_SELECTOR, "#fname") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L17-L19" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.CssSelector("#fname")); @@ -145,10 +143,9 @@ We will identify the Last Name field using it. WebDriver driver = new ChromeDriver(); driver.findElement(By.id("lname")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.ID, "lname") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L27-L29" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Id("lname")); @@ -177,10 +174,9 @@ We will identify the Newsletter checkbox using it. WebDriver driver = new ChromeDriver(); driver.findElement(By.name("newsletter")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.NAME, "newsletter") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L37-L39" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Name("newsletter")); @@ -207,10 +203,9 @@ In the HTML snippet shared, we have a link available, lets see how will we locat WebDriver driver = new ChromeDriver(); driver.findElement(By.linkText("Selenium Official Page")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.LINK_TEXT, "Selenium Official Page") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L47-L49" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.LinkText("Selenium Official Page")); @@ -238,10 +233,9 @@ In the HTML snippet shared, we have a link available, lets see how will we locat WebDriver driver = new ChromeDriver(); driver.findElement(By.partialLinkText("Official Page")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.PARTIAL_LINK_TEXT, "Official Page") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L57-L59" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.PartialLinkText("Official Page")); @@ -267,10 +261,9 @@ From the above HTML snippet shared, lets identify the link, using its html tag " WebDriver driver = new ChromeDriver(); driver.findElement(By.tagName("a")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.TAG_NAME, "a") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L67-L69" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.TagName("a")); @@ -302,10 +295,9 @@ first name text box. Let us create locator for female radio button using xpath. WebDriver driver = new ChromeDriver(); driver.findElement(By.xpath("//input[@value='f']")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.XPATH, "//input[@value='f']") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L77-L79" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Xpath("//input[@value='f']")); diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md index b8e38f81faf..7681f487f5a 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md @@ -51,7 +51,7 @@ page. To understand and create locator we will use the following HTML snippet.

Contact Selenium

- + Male   Female

@@ -81,10 +81,9 @@ available in Selenium. WebDriver driver = new ChromeDriver(); driver.findElement(By.className("information")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.CLASS_NAME, "information") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L7-L9" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.ClassName("information")); @@ -114,10 +113,9 @@ textbox, using css. WebDriver driver = new ChromeDriver(); driver.findElement(By.cssSelector("#fname")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.CSS_SELECTOR, "#fname") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L17-L19" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.CssSelector("#fname")); @@ -145,10 +143,9 @@ We will identify the Last Name field using it. WebDriver driver = new ChromeDriver(); driver.findElement(By.id("lname")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.ID, "lname") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L27-L29" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Id("lname")); @@ -177,10 +174,9 @@ We will identify the Newsletter checkbox using it. WebDriver driver = new ChromeDriver(); driver.findElement(By.name("newsletter")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.NAME, "newsletter") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L37-L39" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Name("newsletter")); @@ -207,10 +203,9 @@ In the HTML snippet shared, we have a link available, lets see how will we locat WebDriver driver = new ChromeDriver(); driver.findElement(By.linkText("Selenium Official Page")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.LINK_TEXT, "Selenium Official Page") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L47-L49" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.LinkText("Selenium Official Page")); @@ -238,10 +233,9 @@ In the HTML snippet shared, we have a link available, lets see how will we locat WebDriver driver = new ChromeDriver(); driver.findElement(By.partialLinkText("Official Page")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.PARTIAL_LINK_TEXT, "Official Page") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L57-L59" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.PartialLinkText("Official Page")); @@ -267,10 +261,9 @@ From the above HTML snippet shared, lets identify the link, using its html tag " WebDriver driver = new ChromeDriver(); driver.findElement(By.tagName("a")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.TAG_NAME, "a") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L67-L69" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.TagName("a")); @@ -302,10 +295,9 @@ first name text box. Let us create locator for female radio button using xpath. WebDriver driver = new ChromeDriver(); driver.findElement(By.xpath("//input[@value='f']")); {{< /tab >}} - {{< tab header="Python" >}} - driver = webdriver.Chrome() - driver.find_element(By.XPATH, "//input[@value='f']") - {{< /tab >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="/examples/python/tests/elements/test_locators.py#L77-L79" >}} +{{< /tab >}} {{< tab header="CSharp" >}} var driver = new ChromeDriver(); driver.FindElement(By.Xpath("//input[@value='f']"));