Questions tagged [xpath]

XPath (XML Path Language) is language for addressing parts of an XML document, designed to be used by both XSLT and XPointer. It also provides basic facilities for manipulation of strings, numbers and booleans. XPath uses a compact, non-XML syntax. XPath operates on the abstract, logical structure of an XML document, rather than its surface syntax.

Filter by
Sorted by
Tagged with
0
votes
2answers
3k views

How do I use XPath to find the values of cells in a table

The structure of the Html I need to work with is shown in the screenshots below. I need to get the values of the first and third column of each data row in the table. There is nothing unique about ...
0
votes
1answer
76 views

Sharepoint Automation

I am trying to automate SharePoint test cases. I am finding an issue while finding an element locator for actual result, updated by, update date. Does anyone know how to find the locators? HTML: <...
0
votes
3answers
899 views

Selenium IDE type not saving text

I am trying to create an automation tool to test a salesforce platform. When I try to create a new form, the text is displayed but it's really just an injection from Javascript. Is there any way to ...
0
votes
3answers
525 views

Selenium Java WebDriver Can not Find Element with xpath

I've a question, how can I capture the xpath in the case below? I tried this: driver.findElement(By.xpath("//*[@id='L2_auto_8']/div/a[1]")); and I tried: driver.findElement(By.xpath(//a[@href='/...
0
votes
2answers
990 views

Help in locating an image button inside div element

So I am trying to automate a test and my issue is that I cannot point to the button element which is actually an image inside of a div. I tried going down the hierarchy but no luck. this is the code I ...
0
votes
2answers
147 views

I am automating coop website and I'm facing problem while customizing XPath for add to cart button

I have customized an XPath for adding a product which has discount 30% for 2. Now I am facing problem while adding this into the cart. package sample; import java.util.ArrayList; import java.util....
0
votes
2answers
894 views

How to locate below element TableHeader using xpath [duplicate]

I want to locate element 'TableHeader' in given DOM, I am using XPath but getting an exception unable to locate the element. Xpath : //div[@class='PageContent']/table[1]/tbody/tr/td[2] Please have a ...
0
votes
3answers
7k views

How to get XPath from different div?

Below mentioned two urls: http://www.espn.com/nhl/boxscore/_/gameId/400896617 http://www.espn.com/nhl/boxscore/_/gameId/400885545 How can I get XPath after player summary content. 1st url is XPath ...
0
votes
1answer
858 views

Selenium script on Pega Platform application behaves weird

I have identified web elements uniquely using customized xpath //table[@pl_prop_class='SOM-FW-PayMaineFW-Data-ProductGroup']/tbody/tr/th[1]/div/div/div[1] But, when I run the test script and ...
0
votes
1answer
1k views

Find text using Xpath with class (vb.net)

Hey guys ! This is on what I'm working on : Dim url As String = "http://brayket.byethost9.com/index.php?/shoutbox/" Dim web As New HtmlWeb() Dim doc As HtmlDocument = web.Load(url) Dim ...
0
votes
3answers
39 views

Regarding taking Xpath [duplicate]

Kindly follow the below HTML code. I want to get the text "DefaultBP" in between the tag. If I using this XPath "//div[@class='workspace']//h1", all the texts including tag such as "Export", "Import"...
-1
votes
1answer
345 views

How to write XPath if my ID is changing continuously? [duplicate]

//*[@id='post-9505']/h3/a/time //*[@id='post-9466']/h3/a/time //*[@id='post-9517']/h3/a/time In this id number is changing continuously, so how can i write dynamic XPath? please help me to write ...
-1
votes
4answers
9k views

Button won't click even though I can see it's taking me to the button when doing automation

My code which takes me to the button and highlights it (I'm running java scripts within Eclipse) driver.findElement(By.xpath("//button[contains(text(),'Save')]")).click(); My HTML code <button ...
-1
votes
3answers
3k views

How do I get particular textNode value of a DOM with Selenium

Hello I am trying to find Load # detail from this site. Also You can refer screenshot too. I have tried with xpath: //div[@class='equipment_item']//text()[preceding-sibling::strong[text()='Load #:']][...
-1
votes
2answers
128 views

WebElement click does not work in chrome browser

I have tried below code : driver.findElement(By.xpath("//*[@id='content']/div[2]/div/div[5]/div/div/res-view-activity/div/div[1]/a[2]")).click(); This works when using Firefox, but does not work ...
-1
votes
1answer
51 views

How can I pass/use a parameter1 value into another parameter2 xpath? [closed]

How can I pass/use a parameter1 value into another parameter2 xpath ?
-1
votes
2answers
104 views

Not able to find the Xpath, really complicated for me. Need help

i am not able to find the xpath for a text box and get the value from it the code is here. please help me find the xpath to locate the box and get the value from it.
-1
votes
1answer
377 views

Capturing the xpath/locator of the Edit Status in Facebook

I am trying to Post a status in FB using selenium. But i am not able to correctly locate the Edit status text and getting NoSuchElementException. I have tried different xpaths, which are correct too ...
-1
votes
1answer
84 views

How to massage or format html in order to parse with xmlstarlet?

Just looking to parse html found "in the wild": Very simple script: curl -s http://www.foo.com > 1.html xmlstarlet fo -H -R 2> /dev/null 1.html > 2.html xmlstarlet sel -t -v "//header[@...
-1
votes
1answer
39 views

Automation Selenium - Dynamic XPath [duplicate]

In the below XPath, the index [1] is changing every time. Can we handle this? //button[contains(text(),'Action')][1] HTML: <button aria-expanded="false" aria-haspopup="true" class="dropdown-...
-1
votes
1answer
808 views

How to create Xpath to read text between span class?

HTML: ...<div class="ArticleCount__articleCount___lQ5f1"> <span class="ArticleCount__text___1c2Rn">Showing</span> 9 <span class="ArticleCount__text___1c2Rn">of</span> 23 ...
-1
votes
5answers
7k views

Unable to click on checkbox using Selenium & Java

please send me the full code I tried Some XPath and CSS: XPath: //div[@id='autofill']/div/label //div[4]/div/label CSS: div.col-md-1.checkbox.checkbox-primary > label* but using above ...
-1
votes
1answer
597 views

How to handle if XPath are different for multiple sub-menu options [duplicate]

I have situation when i have click main menu options it will be display 10 different sub-menu options. In all sub-menu section is available 2nd sub-menu options which is available more than 20 menu ...
-1
votes
2answers
4k views

How to write XPath under tag: strong<> <br> after every <strong>

I am trying to find xpath of text 262567 of given below HTML code : <div class="lessthanhalf" > <h4> Listing</h4> <strong style="background: rgb(204, 136, 136); border: 2px ...
-1
votes
1answer
48 views

Unable to customize xpath

I want to select all the products having rating 4.5, I could do that with the help received from StackExchange. Now I want to add the products with rating 4.5 to the cart. However, I am not able to ...
-1
votes
3answers
1k views

Appium - why does XPath not work (at all / as expected)

Consider my below test code for Appium (WinappDriver). As far as I know, these two locators should be equivalent. Yet the second one fails because the element cannot be found. Is there any reason ...
-2
votes
4answers
1k views

Unable to customize XPath containing span

I want to select all the products having rating 4.5 and add to the cart. However, I am not able to customize the XPath. I tried the below XPath: //div[@class='product-item__rating']/span This ...
-2
votes
0answers
54 views

Assert Fails Though Text Values available in that XPath

I'm working in selenium with c# Assert is not working though xpath is given correctly. xpath shows only one item. It was working correctly quite sometime back. Here is my piece of code. Assert....
-2
votes
3answers
3k views

Unable to find the element using XPath

XPath: //*[@id=\"clB\"]/div[1]/div[1]/a/div Exception: Exception in thread "main" org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath ...
-3
votes
1answer
722 views

XPATH FACEBOOK How can i get xpath or css selector ? - selenium/java [closed]

I automated some facebook functions for pratice selenium, but i can't click on search options. How can i try this ? Search: elements:
-3
votes
1answer
302 views

Unable to locate element using this XPath [closed]

This is my xpath - //*[@id="284623"]/div[4]/div[4]/img Unable to locate element using above XPath. Please help..!
-4
votes
1answer
2k views

How to write XPath under tag: strong

I want to red text under strong tag I have written XPath like: //section[2]/section/div[1]/div/div[1]/div[2]/text()[1] Here is the HTML code: <div class="listing-info"> <h4>Listing ...