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
-1 votes
1 answer
40 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....
Nethmi Edirisooriya's user avatar
0 votes
0 answers
39 views

why my page is not scrolling full at the bottom in selenium testNG(java)?

The images below are my codes(Singleton,homepage and test classes) I'm new to automation and I tried to achieve POM using Singleton now my problem is whenever I try to run my test cases it navigates ...
Shabbin Hossain's user avatar
0 votes
0 answers
60 views

Can't click on element in selenium

I am trying to click on this element in selenium for login but it wont work for me. This is my code for it driver.FindElement(By.XPath("//div[@id='otherTile']")).Click(); But it wont work. ...
ghosty's user avatar
  • 1
0 votes
1 answer
152 views

How to capture the element using srcset attribute?

I'm trying to understand the difference between the data-srcset and srcset attributes. I need to get a photo by the srcset attribute, but I can only get it using data-srcset. I don’t really understand ...
invzbl3's user avatar
  • 121
0 votes
1 answer
61 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 ...
pedro's user avatar
  • 1
0 votes
1 answer
201 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-...
Amel Krupalija's user avatar
0 votes
1 answer
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 ...
user55499's user avatar
1 vote
1 answer
766 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="...
David's user avatar
  • 11
0 votes
4 answers
466 views

Selenium Locators are not working for this site?

public class LoginPage { WebDriver driver; @FindBy(xpath = "//input[contains(@class,'oxd-input') and @name='username']") private WebElement userName; @FindBy(xpath = "...
harry234's user avatar
0 votes
1 answer
79 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. ...
Adrian Leonhard's user avatar
1 vote
3 answers
559 views

Unable to fetch text values present within strong tag using xpath

While trying to print values present within the strong tag using XPath, I'm getting the following exception: org.openqa.selenium.NoSuchElementException: Unable to locate element: strong This is my ...
nayansFosgit's user avatar
1 vote
1 answer
211 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 ...
Erkan Arslan's user avatar
-1 votes
2 answers
170 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]/...
VlWWv's user avatar
  • 1
0 votes
2 answers
164 views

Selenium : Unable to identify the Xpath of the Grammarly extension in chrome

Unable to get the Xpath for the Grammarly extension which has been added into chrome browser as an extension. In the screen shot below , I am using GMAIL , but you can use any other website like https:...
Mohammed A Zahid's user avatar
-1 votes
1 answer
865 views

How to get the correct XPath for a column title using C# and selenium webdriver?

I have the following HTML <label class="ms-Label headerText-269" title="Reference Id">Reference Id</label> which I am trying to locate using XPath. I have written the ...
RShome's user avatar
  • 101
2 votes
3 answers
595 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 ...
Benjamin Ansell's user avatar
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=&...
Haris Psarropoulos's user avatar
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 = "...
user avatar
-1 votes
1 answer
71 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?
user52444's user avatar
0 votes
2 answers
97 views

How to find xpath of "BBB element in following example?

I am unable to find xpath of "BBB" in following span class example. <span class="xyz"> "AAA" "BBB" "CCC" ==$0 </span>
Anu's user avatar
  • 1
0 votes
4 answers
6k views

Selenium - How to remove &nbsp 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 &nbsp in the HTML, and the code doesn't detect the text ...
Yan's user avatar
  • 11
0 votes
1 answer
2k views

Selenium - cannot click on radio button

I have tried all the possibilities but am unable to click the radio button Yes or No. It would be great if I get some help. I have observed that Need to take this attribute (<span radiogroup class=&...
Mythri N's user avatar
1 vote
2 answers
319 views

Unable to capture the element using xpath

I'm trying to capture the dynamic code using xpath(Selenium+Java). I want to get that code and store it in a variable, but it always returns no such element exception. My xpath looks like below when ...
Rush910's user avatar
  • 137
0 votes
1 answer
1k views

How to write xpath or css for background-image value

I wanted to write Xpath or css for <div class="img"style="background-image:url(//cdn.shopify.com/shopifycloud/shopify/assets/no-image-2048-...
user51729's user avatar
0 votes
2 answers
94 views

What was your most annoying website you have ever found when creating dynamic Xpaths

When interviewing a candidate for QA automation positions, I used to give a website URL and ask them to create a dynamic XPath for a given element. It's mostly on https://opensource-demo.orangehrmlive....
ChathuD's user avatar
  • 2,149
-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. ...
Zplinter's user avatar
1 vote
2 answers
957 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 ...
jay m's user avatar
  • 61
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 ...
DrewTheTester's user avatar
1 vote
2 answers
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 ...
Brian's user avatar
  • 11
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....
user50114's user avatar
-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 ...
anurag vyas's user avatar
0 votes
3 answers
2k 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 ...
Rahil Kumar's user avatar
0 votes
2 answers
4k 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> ...
jeremy_rutman's user avatar
0 votes
2 answers
1k 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.
Ash's user avatar
  • 11
0 votes
2 answers
527 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(),'{...
Ashish Ahuja's user avatar
0 votes
0 answers
236 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=&...
Lenin Espindola's user avatar
1 vote
2 answers
485 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,...
cmotto's user avatar
  • 11
0 votes
2 answers
2k 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 ...
Quinten De Wilde's user avatar
0 votes
3 answers
155 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]/...
locke's user avatar
  • 65
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 ...
TechGeek49's user avatar
0 votes
1 answer
2k 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, ...
nick's user avatar
  • 1
3 votes
1 answer
4k 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 ...
anmol agha's user avatar
-1 votes
1 answer
1k 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 ...
mwalker1981's user avatar
1 vote
1 answer
3k 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 ...
illuminato's user avatar
1 vote
1 answer
623 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 &...
EyalH's user avatar
  • 11
0 votes
1 answer
745 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 ...
Artportraitdesign1's user avatar
0 votes
1 answer
3k 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....
Nikhil_Coder's user avatar
-2 votes
3 answers
52 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 ...
Protocoder's user avatar
1 vote
1 answer
127 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]/...
user46038's user avatar
2 votes
1 answer
515 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 &...
PerfectLikeNew's user avatar

1
2 3 4 5
7