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
1answer
28 views

Unable to find XPath for mouse hover

I can't find my XPath so that I can't run the code. Can anyone solve this issue? I have to do mouse hover manage content then click on content Library: package TestNG; import org.testng.annotations....
-1
votes
1answer
34 views

Not able to click() on newly added account number from a account list on the page

A new account is created using selenium script and a message appears that "Account is created successfully : <***12345>" After this, Account page is displayed where all the accounts ...
0
votes
3answers
55 views

How to pass text dynamically in xpath under Properties file

I am stuck in a situation where I want to write Xpath dynamically in the properties file. The actual XPath is like in property File div[contains(text(),'<state Name>')]. State Name changes ...
0
votes
2answers
70 views

Finding sibling of found element using selenium

I've got a field with a date in it that's identified by a code that's shown in the div previous to it. <div class="fcode"> <div class="fcode_n">(123)</div> ...
0
votes
2answers
47 views

The relative xpath for the 2nd button of two identical buttons - selenium

i need to identify the relative xpath for the 2nd button highlighted in the image Can someone help me //*contains(@class,'fa fa-clock-o') I used this. It identifies the first button again.
0
votes
2answers
38 views

I have a dynamic xpath which is based on 4 values, if I am using OR condition the xpath looks huge, any other way to handle this?

_OPTION_1 = "Average" _OPTION_2 = "M" _OPTION_3 = "Casual" _OPTION_4 = "D" _WIDTH_VALUE_XPATH = f"//mat-option/span[contains(text(),'{...
0
votes
0answers
18 views

ExtJS. How to select options from <Input>, if options is in downside DOM in div's? Selenide

I have an enterprise project. Dropdown menu's made so: There's field <input type="hidden" name="Some_id" id="Some_id" value="6"> <input type="...
0
votes
0answers
27 views

How to ignore unnecessary attributes in my response.xpath?

I am trying to scrape some data with scrapy using xpath selectors and i would like to get rid of the unnecessary data, the xpath selector is the following: values = response.xpath ('//table[@class=&...
1
vote
2answers
31 views

Cannot select html td link button by XPath with Webdriver

Here is my element <td> <div class="linkButton" onclick="window.open('../../Report/Reports/ViewReport.aspx?reportName=Revenue.Report','Report1','scrollbars=1,resizable=yes,...
0
votes
2answers
24 views

Extract InnerHTML from

Is there a way that I can extract the following data in Chrome Devtools Console. Currently I do the following in the console of the chrome devtool: $x("//a") I get a list with all the a ...
0
votes
0answers
50 views

Selenium IDE - how do I 'click' custom Angular events?

I'm trying to test/debug an Angular app that generates a calendar (note: I cannot currently modify the application.) I believe the Angular calendar used is: Components / CalendarMonthViewComponent I'...
0
votes
3answers
67 views

Issues creating custom xpaths

I've became lost in the world of xpaths, so got an advice to create custom xpath, instead of coping this one, for example "/html/body/div[1]/div[4]/div[1]/div[7]/div/div[2]/div[3]/div/form/div[2]/...
0
votes
0answers
28 views

How to choose a result in a dynamic webtable that has the same name and later timing in Selenium Python?

I have been working on a Selenium project in Python where I want to choose the result which has a later timing than the earlier one but have trouble implementing it. What I meant is this, Example if ...
0
votes
1answer
209 views

How to find all child elements inside a WebElement or List of WebElements in Selenium?

I have a <section> tag in which there is <tfoot> tags and many <td> tags. I want to store the 1st & 4th td elements of a in a Map, but i get index out of bounds exception. Now, ...
1
vote
1answer
253 views

locating element with one class out of multiple classes inside a div using xpath in selenium

I have below two input fields and I have to find there location I can't use class selector cause iI have to identify element based on formcontrolname and ng-invalid class <div> <input ...
-1
votes
1answer
40 views

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

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 ...
1
vote
1answer
947 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
1answer
341 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
233 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
1k 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
48 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
45 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]/...
2
votes
1answer
235 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
33 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
76 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
198 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
124 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
688 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
229 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
82 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
32 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
2k 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
308 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
493 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
1k 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
90 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
525 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
28 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
1k 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
69 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
365 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
73 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
1k 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
7k 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
1k 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
123 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
488 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
452 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
2 3 4 5
7