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
0answers
28 views

How can i click on a “SVG” dropdown element and select an option in Selenium? [closed]

How can i click on a "SVG" dropdown element and select an option in Selenium? the problem is that i cant see any child elements on the "svg" element, other than path. //*[@id=&...
0
votes
1answer
24 views

Understand How to Click on an a Table Element (URL) Based on a Value in that Same Row Using Selenium

I am automating steps in a browser using Selenium/Python; however, I am stuck with trying to understand how to get Selenium to recognize a text value in a table and click on the URL in the ...
0
votes
1answer
35 views

RobotFramework: Link/List with locator not found

I am studying Robot Framework with Selenium Library and I can't figure out how to remove "kw" element from the next dropdown: I tried to use xpath for it: *** Settings *** Library ...
1
vote
0answers
33 views

Automating a comment delete on FB with Selenium

I am trying to automate deleting my old comments on posts I've made on FB. Im using Selenium with python to achieve this. I am currently having trouble dealing with pressing the hidden buttons (1 &...
0
votes
1answer
71 views

Selenium C# Locate Both Data QA Attribute And CSS Class

How do we locate both Data QA Id and CSS Class using Selenium C# ? We're trying to locate both a DataQAid attribute and also see if its class ng-invalid, (Angular Material Textbox Error) This is what ...
0
votes
1answer
113 views

Unable to fill the card details for Payments using Selenium at the merchant's checkout page

I have just started learning Selenium web automation tool and wanted to auto-fill the card details on the merchant's Payment Page but unable to do so using Selenium. Below are the things which I tried....
-2
votes
3answers
46 views

XPATH clarification [closed]

Refer: Picture of elements of HTML screenshot I am trying to get XPATH //*[@id="pg:pbEdit:conlist"] or //select[@id="pg:pbEdit:conlist"] Works but I want to be precise not ...
1
vote
1answer
35 views

Variable in Xpath is not working

#driver.find_element_by_xpath('//div[@id="groups"]/div/div/div/div/div[2]/div[1]/div/div/button').click() i = 5 gPath1 = str("\'//div[@id=\"groups\"]/div/div/div/div/div[2]/...
1
vote
1answer
52 views

Using loop how to get dataframe from each next pages and store table values using Selenium Python

https://seffaflik.epias.com.tr/transparency/tuketim/gerceklesen-tuketim/gercek-zamanli-tuketim.xhtml from the above website, I've achieved to enter date picker for two date range and then clicking &...
0
votes
1answer
31 views

How do I write a better xpath of this element? [duplicate]

I am working on a project and building automation test suite for a webpage. A certain part of the webpage looks like this. The corresponding HTML is as follows: <p class="customer-service&...
0
votes
1answer
42 views

I want to enter text in search text box and click search icon or enter [duplicate]

I am facing the issue . Kindly assist. The HTML Code snippet is attached I am getting the error as Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: ...
0
votes
1answer
55 views

Finding a xpath for text which is followed by break tag

I have below HTML code, in that I have to come up with XPath for the 2nd line of text: "Policy Count - 0". <h2 id ="lblpremiumVol"> "Premium Volume - $" <br> &...
0
votes
4answers
53 views

How to write the xpath for an element preceded by another element?

I want to get the value from an element based on the element preceding it. For example, getting the value "YYYY-MM-DD" based on the element "date" Here is the html snippet:
0
votes
1answer
342 views

Error: Exception in thread “main” java.lang.NumberFormatException: For input string: “”

Scenario: I am using Selenium Java. I need to add items to the cart and calculate the total price of the items in the cart. Url: https://rahulshettyacademy.com/seleniumPractise/#/ Issue: My code is ...
2
votes
1answer
39 views

The instruction (Keys.ARROW_DOWN) is moving the cursor to the bottom of the dropdown list instead of the first option

Scenario: To search and select the first destination location that matches the input string using the below code. Code snippet: driver = new ChromeDriver(); driver.manage().timeouts()....
2
votes
1answer
47 views

The value from the table is different using Xpath and CSS selectors

Test url=https://www.cricbuzz.com/live-cricket-scorecard/22585/aus-vs-nz-1st-odi-new-zealand-tour-of-australia-2020 I am trying to get the title of a table using the below code: Code snippet: ...
-1
votes
1answer
21 views

How to get “10:20 AM IST” from that code using xpath in selenium

<div class="game-date-time"> <span data-date="2017-03-11T04:50Z" data-behavior="date_time"> <span class="time game-time" data-dateformat="time1" data-showtimezone="true">10:20 AM ...
0
votes
1answer
400 views

Problem with finding element with Selenium and Xpath

I have a problem that is very strange for me because the code that I wrote, I am quite sure should work! Config Details Chrome version: 80.0.3987.132 ChromeDrivers version: same as ...
0
votes
1answer
115 views

No Such Element (Selenium) [duplicate]

I have checked far and wide for a fix for this. But to no avail. Nothing seems to work. I am trying to locate a Username and Password box to enter in the information. But it comes up with the error ...
0
votes
5answers
306 views

Element not found in a runtime

I am encountering a very unusual thing, the one I haven't seen before. There is one element I needed to find for testing purposes, it is visible on the page and I can find its unique relative XPath ...
-1
votes
3answers
539 views

Retrieving an XPath Text from a Web Element [closed]

I have a task where I need to retrieve the following text in black color highlighted in yellow. It is not within any tags and has no attribute. Once you locate a web element through the Inspect option,...
1
vote
1answer
68 views

How to get xpath of only the categories for checkboxes

I am trying to find the xpath / count for all the checkboxes under "Categories". but when I am trying to get xpath/count it is getting me all the checkboxes under "Categories" and under "Brands" How ...
0
votes
4answers
210 views

Not able to find the unique xpath for an element in expedia.com using Selenium

I am trying to find the unique xpath for elements in the "travelers" pop option in the home page of expedia.com When I give the following xpath "//div[contains(@class,'gcw-menu')]/div/div1/div2/div[4]...
0
votes
0answers
37 views

Unable to find the xpath [duplicate]

I am unable to find xpath for the below success message: WebElement successOverlayMsg = findElement(By.xpath("//*[text()='A new app overlay \"APAutomation_Merchant_M32XphDFc\" has been created ...
0
votes
0answers
27 views

How to apply a 'Loop' to map the row element where XPath changes whenever page get's loaded [duplicate]

How to map on to a particular row element say " NCC "where the number of the row containing that element changes whenever page get's loaded. Reference website-guru99 for(int i=0;i<19;i++) ...
0
votes
1answer
635 views

Cannot find an element with Xpath in Appium

I'm new to Appium. Sorry if the question is duplicated, but I did not find the solution. I have a problem - I cannot locate an element using Xpath, but I have no problems locating it using the ID ...
-1
votes
1answer
66 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 ?
0
votes
7answers
225 views

How to handle changing absolute XPath?

/html/body/div/main/div/div/div[2]/div/div/div/div[1]/div/div***[4]***/div/div[2] The div[4] element keeps changing. If a new item comes into the web, the div number changes. How do I handle this?
0
votes
1answer
52 views

Finding an item in a table - Selenium scripts

I need to select/click an item from the table. I'm new/beginner to selenium. when I inspect the individual property, it has: <a id = "rpn" style=”cursor: pointer”, ng-click=”grid.appScope....
1
vote
2answers
687 views

How to resolve 'Cannot convert from void to WebElement' error in Selenium

I am getting below error: Error: Type mismatch: cannot convert from void to WebElement. CODE: WebElement uploadElement = (driver.findElement(By.xpath("//input[@id='HorizontalLogoPath']"))).click(...
1
vote
3answers
4k views

Stale element reference: element is not attached to the page of the document

I would really appreciate if someone could help figure out what the hell is going on with one of my tests. I'm getting Stale element reference: element is not attached to the page of the ...
2
votes
0answers
37 views

How to handle n number of dropdowns fields with same xpaths [closed]

I have two drop down fields that are parallel and there is a button as well from where more fields can be added at every row. There is no limit on the fields to be added and have to fetch values from ...
2
votes
1answer
653 views

Selenium python checkbox by span class

I have an issue with checkbox check in selenium python, I want to make not exact xpath, but something like I did earlier in the code : browser.find_element_by_xpath(".//span[contains(text(), 'Dalej')]"...
2
votes
0answers
118 views

How to get text from span that is not in Latin Alphabet? [closed]

I'm having difficulty getting text between span tags. The problem is that the said text is not written in Latin Alphabet. I have no problems using UTF text as part of xpath locator. My xpath looks ...
1
vote
3answers
219 views

How do find XPath when only value is given in the source code?

What will be the XPath of a 'Search' button from the expression mentioned above?
1
vote
1answer
283 views

Selenium C# Using relative XPath inside the wait.Until()

How do you use a relative xpath inside of a wait.until? For example, the below will work: elementA.FindElement(By.Xpath(.//div)); However, putting a 'FindElement' inside of the wait.Until() ...
-1
votes
1answer
58 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-...
3
votes
2answers
157 views

Why doesn't my XPath find my element on the page?

I am trying to retrieve the content of the header and each chapter which is a repetitive structure as you can see below. For this am using Selenium and C#. My attempt, using xpath, is this: string ...
0
votes
1answer
39 views

not any locator works My Email address field are not fields automatically in testing selenium on login page

import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox....
0
votes
3answers
463 views

How to identify the web-element for a Text Box using Selenium

I am attempting to locate the empty textbox by the input id 'Department_input' <input id="Department_input" type="text" aria-required="true" size="40" class="field_input ui-widget-content" ...
0
votes
2answers
684 views

Unable to find xpath using position(), last(),[1] indexing([1]--eg.) following:siblings, child, parent nothing is working

I am trying to find out the XPATH. I am getting 30 matches for an element. I tried using last(), position(), indexing[], child, parent, following:siblings, preceding:siblings, absolute XPATH is also ...
0
votes
2answers
59 views

How to write an xpath for a specific text from a whole attribute?

So the problem statement is: I need to store a specific number(marked in RED) from the attribute & for that I want to point to that number in an xPath. Is that possible?
1
vote
3answers
292 views

How to get XPath for the text after the <b> tags

I Need to get XPath for the following, to get the text after the <b> tags <li class="SpacedOut"> <b>Name 6:</b> "ABC" <b>Name 1:</b> "BCD" <b>Name ...
0
votes
1answer
302 views

Verify and Assert functions does not work as expected in Selenium IDE?

I'm using Selenium IDE to record steps. Web system has developed using Angular.js I tried to use verify text and assert text functions through IDE. For target elements, xpath is given. Same xpath is ...
0
votes
1answer
348 views

How to deal with ui-sref in Selenium

The Context: I'm using selenium in java to click on a link to navigate to the other page of the application. The Problem: The application is made in angular-js wherein I tried to click on the Link,...
1
vote
1answer
110 views

Testing a pop-up in Selenium

How to select text from pop up which is opened in the same page in Selenium. With WebDriver I can only check the element from the page, not from pop up.
0
votes
1answer
66 views

Locator Issue regarding multiple attribute

I've located an element correctly by using the following XPath... //a[@class=\"desktop-categoryLink\"][@data-reactid="30"] But when I paste this in my eclipse it looks like below... driver....
0
votes
2answers
44 views

find xpath for 'PAINEL DE CONTROLE EDITORA'

Facing issues while locating element outside the span please refer the images and post the xpath for it. Update: I have tried the suggestion in Upkar Singh's answer and the xpath below with no ...
0
votes
1answer
38 views

Unable to find the element within frame

i cant click the menu named biometric check list. there's total five frames and i started to read it from first index. getting unable to locate an element error. What might be the reason any idea. ...
0
votes
3answers
2k views

Unable to find element with css selector == input[name='username']

WebElement username = driver.findElement(By.cssSelector("input[name='username']")); The statement mentioned above was working before but right now concerned element can't be captured and error ...

1
2 3 4 5 6