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
31 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....
0
votes
2answers
48 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
672 views

Selenium auto-selected the second element returned using the findElement method

As per the below code, I navigate to a specified URL and select the values in the from and to field. The xpaths mentioned in the 3rd and 4th line, each returns 2 instances. In the third line, ...
1
vote
5answers
9k views

Unable to click button using Selenium Webdriver Java

I am trying to click a button through webdriver. After inspecting the button element it highlights to the following: XPath: /html/body/div/div/main/div/div[2]/div/div[2]/table/tbody/tr/td[4]/form/...
1
vote
3answers
572 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
2answers
72 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
5answers
8k 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
vote
6answers
3k views

How to locate the XPath of an element in eclipse accurately?

I am working on a project in which automation is done using Appium Tool. I felt it difficult to track the XPath of an Image or Textbox in Eclipse while scripting. Sometimes the XPath will be given as ...
0
votes
4answers
3k views

Not able to click on menu using Selenium WebDriver Java

I am not able click on the specific element, which is in the image format. I have tried using available locators i.e id and image using XPath and remaining locators are same for all remaining menus. ...
2
votes
5answers
1k views

Xpath: which is much more reliable source - Chrome or Firefox?

On Google chrome, inspecting an Element and copying it's xPath gives me the following value //*[@id='Body']/app-root/app-generic-product/section[2]/div/app-product-summary-list/app-product-summary[2]/...
-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
56 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
4answers
950 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
9k 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 ...
-1
votes
6answers
13k 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 ...
32
votes
5answers
250k views

A way to match on text using CSS locators

So I use xpath locators and slowly converting to CSS. I haven't found a way to do an exact match based on text. For example converting //a[text()='Log Out']. I know you can do css=a:contains('Log ...
0
votes
3answers
2k 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
1answer
132 views

Python Dryscrape - how to select child element

I'm working on a project with www.NJMLS.com. I'm trying to extract email of agent name "Edward An": import dryscrape as d d.start_xvfb() br = d.Session() br.visit('http://www.njmls.com/members/index....
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
2answers
446 views

How to click on an iOS MobileElement (button) which is dynamically changing using XPath

Below is the XPath- //XCUIElementTypeButton[@name="8/13"] The numeric value in the above XPath changes and is not static. There are more then 10 buttons on the screen, I want to click on the first ...
0
votes
2answers
176 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....
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,...
4
votes
3answers
1k views

How to use Jmeter Xpath extractor for multiple run in dynamic API elements

XPath extractor response assertion passed first run but in second run it is getting failed because <name>pc</name> is not coming in API. How to skip this element if it is not coming in ...
4
votes
2answers
31k views

how to handle if xpath is same for multiple drop down

I have a situation where i had to handle drop down and click the drop down to select some values. There are two drop down in same page and both has same xpath. The Xpath is giving below. //div[@name=...
2
votes
1answer
239 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
0answers
19 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
28 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=&...
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
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
53 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
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
0answers
29 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 ...
2
votes
2answers
6k views

How to add HTML/text content of a <div> into an array/list?

I am new to selenium and working with xpath. I am using selenium and java to write automated tests for chat messaging web application. I am looking for a way to take a webElement which contains ...
10
votes
4answers
94k views

Webdriver: How to find the element using text() in xpath?

I'm new to selenium and HTML. I want to perform click operation for the elements "Users" and "Admins" as one after another. Below mentioned is the HTML code, unfortunately I can't modify it. <ul ...
4
votes
6answers
30k views

How to locate an element which is visible only by mouse hover in selenium webdriver

I want to find an element which is visible by mouse hover and I need to click on it and it then opens a text field. When I give the XPath for the element in fire-path, it detects 6 instances of the ...
0
votes
1answer
220 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, ...
6
votes
5answers
12k views

how to find element by xpath for android appium

Since these nodes don't have ids and text, I have used xpath to find the element but find element fails I have tried different xpaths as below but none work. xpath=//android.view.View[10] xpath=//...
21
votes
6answers
92k views

How to handle dynamic changing ID's In XPath?

How to Handle Dynamic Changing IDs In XPath? for example : //div[@id='post-body-3647323225296998740']/div[1]/form[1]/input[1] In this xpath id "3647323225296998740" is changing every time when ...
0
votes
2answers
5k views

Locating Inner Text with CSS or Xpath in Amazon

I am teaching myself automation with Selenium web driver, and thought a good way was to learn off an ecommerce site such as Amazon. I am trying to locate inner text with CSS and used the following to ...
1
vote
1answer
346 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
5k views

How to handle web element(enable button) having same Xpath?

I am working on a web page which having 3 web elements with 3 enable buttons and all buttons having same Xpath.so my need is to click on the button A and print the title of the webelement on every ...
1
vote
1answer
271 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
956 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
2answers
6k views

Protractor - Passing a variable in xpath

I am automating my application using Protractor. For one of the elements, I am using xpath, which is as follow: element(by.xpath('//ul[@id="employee-list"]/li[contains(text(),"Master ...
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....
1
vote
1answer
853 views

Add XPath parameter dynamically in Selenium

Is it possible in Selenium to add an XPath parameter dynamically? I have following code: @FindBy(how = How.XPATH, using = "//div[@class='boxes']") public List<WebElement> boxes; String ...
0
votes
1answer
234 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
6answers
9k views

Xpath is Unable to Locate Element.

Can anyone help me in writing xPath for below image, I wrote one but it's not working. My xPath is //li[@class='active']//a[@class='dropdown-button btn']
-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
2 3 4 5
7