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.
39
questions with no upvoted or accepted answers
4
votes
3
answers
2k
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 ...
2
votes
3
answers
752
views
How to find a specific occurrence of a field that exists in multiple places (Xpath)?
I'm new to Xpath and I wanted to know if there was a way to inspect a specific element, that is repeated multiple times throughout the webpage.
For this instance I want to inspect the specific span ...
2
votes
0
answers
528
views
decompose an HTML list with page fragments
note: Looking for simplest possible example of PageFactory and fragments. I've been referencing an article which uses additional libraries I wasn't aware of.
The desired structure:
Where there's ...
2
votes
0
answers
552
views
Unable to locate the elements of SmartGWT application using Selenium in IE browser
I'm testing a GWT + SMARTGWT application and I'm trying to locate the elements of this web application using Selenium Webdriver. The method which I have used to locate the elements is by the relative ...
1
vote
0
answers
906
views
How to select city based on city name in mat-option-text?
I need to find a specific city from a drop down list. I have tried using the xpath but the id number for the city keeps changing. The element from the website is below:
<mat-option role="...
1
vote
1
answer
229
views
I can't find element in a HTML file with XPath
I am trying to get the name and the price information from this website with XPath. When i write my XPath expression down in the search bar it locates correctly in the chrome. But in VSC it doesn't ...
1
vote
2
answers
1k
views
On selecting the radio button how to get the text of the selected radio button where the text is in the next column
On selecting the radio button how to get the text of the selected radio button where the text is in the next column
I randomly select the radio button and then i need to Store the selected Radio ...
1
vote
1
answer
1k
views
XPath 'list' object has no attribute 'click'
I'm trying to select a checkbox on the following public web-page using Selenium XPath from Python and click it to change the checked status.
http://simbad.u-strasbg.fr/simbad/sim-fout
For example, the ...
1
vote
0
answers
299
views
Using FindBy in abstract class
I have couple of pages that have similar structure, similar elements.
But selectors are different from the first tag.
Example:
Selector for the element on one page:
@FindBy(xpath = "//picture-item//...
1
vote
2
answers
4k
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
7
answers
11k
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
3
answers
3k
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 ...
1
vote
0
answers
681
views
Unable to Switch to iframe in IE
Code Trails:
driver.switchTo().defaultContent();
List<WebElement> before = driver.findElements(By.tagName("iframe"));
for (WebElement t : before) {
System.out.println("iframe" + t....
1
vote
0
answers
176
views
How to inspect an element with multi attributes by OR operator in Page Objects model in watir?
I have a problem when trying to find an element with the different attribute as sample bellow
<i>bold</i>
Sometime
<i class='icon'/i>
I want to try inspecting this element with OR ...
1
vote
3
answers
4k
views
Selenium is not finding button even though it has a Class Name and XPath
I am attempting to click a save button but Selenium (with Python) is having issues. I keep getting the error, "Message: no such element: Unable to locate element"
Here is the HTML
<input ...
1
vote
1
answer
227
views
Which is more efficient mechanism for Object Identification in QTP - Xpath or Ordinal Identifiers?
Which is more efficient mechanism for Object Identification in QTP - Xpath or Ordinal Identifiers ?
0
votes
1
answer
75
views
Testing load of a highchart using python and selenium
I am writing a program that must screen some charts, the issue is that I do not know how much time a graph expends to load, it could be seconds or minutes.
How can I make an appropriate wait, that ...
0
votes
0
answers
2k
views
Robot Framework how to set a variable in an xpath?
Trying to set a variable in an xpath that I can then replace the text in for a dropdown menu. Not sure if there is a better way to do this I have tried "Replace Variables" also from the ...
0
votes
1
answer
86
views
How to find an unnamed button belonging to a certain h2 entry XPath
(I am a bit of a StackOverflow newbie, so please forgive any beginner mistakes and let me know what to improve in the future)
I am trying to select the highlighted button in the appended picture.
...
0
votes
1
answer
1k
views
Problem finding element with text when the text contains &nbsb;
I have the following element in the DOM:
<div id="sourceListDiv">
<select id="sourceList" onkeydown="uil.handleKeyDown(this)" size="15" ondblclick=&...
0
votes
1
answer
2k
views
Xpath to an anchor returning error: unable to locate element
I am new to automated testing. I am using C#, Selenium and Chrome 99 with the correct driver. I am trying to get to an anchor tag on the page.
Here is my code that is not working,
driver.Url = "...
0
votes
4
answers
7k
views
Selenium - How to remove   from my text value
I am trying to use this xpath to find the number of elements that have a value between X and Y. The problem I am facing is since there is   in the HTML, and the code doesn't detect the text ...
0
votes
1
answer
1k
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
0
answers
265
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
0
answers
110
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
1
answer
223
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/...
0
votes
4
answers
4k
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.
...
0
votes
2
answers
1k
views
How to click on an iOS MobileElement (button) whose attribute "name" is dynamically generated on the run 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
2
answers
20k
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
2
answers
254
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
1
answer
246
views
Trying to select element from dropdown
After dropdown is expended how can I select an option from the dropdown which is in span
image of the expanded dropdown https://prnt.sc/k-rFIUa6Ixeo
HTML:
<span class="ant-select-selection-...
0
votes
2
answers
5k
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>
...
-1
votes
1
answer
49
views
Microsoft Account SignIn button cannot be clickable (Java Selenium Excel)
This is my code
public void AccessLogin() throws IOException, InterruptedException {
WebElement oauth = driver.findElement(oAuth);
oauth.click();
driver.get("https://login....
-1
votes
1
answer
74
views
I want to select a checkbox, how to obtain a xpath for the picture below anyone?
Please help me with the xpath for the above picture to select a checkbox?
-1
votes
2
answers
25
views
xpath find the right number
When I right-click and copy XPath this is what I get
//*[@id="AssetPreview_0"]/div[7]/div/div[1]
The information I want to gather is 119 this is the price of the asset I want to buy.
...
-1
votes
1
answer
52
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 ...
-1
votes
6
answers
16k
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
1
answer
183
views
Google Sheet importxml tr td
wishing to export the values in the red area into google sheets, i can't get the xpath corectly. Thanks a lot
Edit: I tried using this, and it s said that is empty
"=IMPORTXML(A2,"//div[3]/...
-2
votes
3
answers
8k
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 ...