Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
22 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 ...
5
votes
3answers
289 views

Can we programmatically update locators on UI Change in UI test automation?

I have been working in test automation for the last 10 years. The problem that keeps coming up and surprisingly is still unresolved is: Can we programmatically update locators on UI Change in UI test ...
0
votes
1answer
52 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//...
0
votes
1answer
35 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,...
0
votes
2answers
103 views

Unable to locate Text element using XPath in Selenium [closed]

This is my HTML page and I have some problem with my automation code and it is not able to locate the element and this is the XPath I used: @FindBy(xpath="//div[contains(text(),'Done')]") HTML Code: ...
4
votes
1answer
569 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 ...
1
vote
1answer
26 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
2answers
140 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
2answers
38 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

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

could not be scrolled into view - loop over options of menu

I have a page in which you click on date first, then region and finally province and get a link to download a file. I am trying to create a loop that goes throuth all the dates, regions and provinces, ...
0
votes
3answers
58 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 ...
0
votes
1answer
40 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
24 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. ...
1
vote
1answer
2k views

Unable to find element for a button in angular application through selenium webdriver

<span ng-click="addReqPage()" class=" wrapper-xs text-center cursor-pointer" tooltip-placement="bottom" data-toggle="tooltip" tooltip="Add Specification"> <!-- ngIf: ...
0
votes
1answer
770 views

Selenium script on Pega Platform application behaves weird

I have identified web elements uniquely using customized xpath //table[@pl_prop_class='SOM-FW-PayMaineFW-Data-ProductGroup']/tbody/tr/th[1]/div/div/div[1] But, when I run the test script and ...
0
votes
2answers
108 views

Selenium can't locate element by xpath

I am using Selenium and attempting to locate an element (table cell in a web app) by xpath. However, I am getting a NoSuchElementException when running my test cases. I am positive that the xpath ...
0
votes
4answers
835 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']
0
votes
1answer
29 views

how can i capture src in xml by using cssSelector or Xpath?

how can i capture src in following xml by using cssSelector or Xpath ? <INPUT src="/TelsimGlobal/Menu/image3.gif" type=image> i tried to execute following ones but always faced with "Unable to ...
1
vote
3answers
59 views

Select element by containing text without XPath in Selenium

There is a great discussion on what makes a good Selenium locator here. It seems many testers prefer CSS to XPath for locators, for various reasons. And that goes for me, too. But, it is often ...
0
votes
1answer
81 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
393 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
88 views

How to find an element which doesn't have proper attribute

I need to click on an element which is inside the div tag. I tried using the xpath which when used detects the element both in console and in the Katalon ide. But when the script is run, it doesn't ...
0
votes
2answers
606 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
2answers
453 views

Can we use css properties (like background-color) for locating an element when that property is not part of the element attributes

Can we use css properties (like background-color) for locating an element when that property is not part of the element attributes? Like If I have to get the xpath or css of this element, either I ...
0
votes
2answers
59 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, ...
-2
votes
4answers
4k views

Button won't click even though I can see it's taking me to the button when doing automation

My code which takes me to the button and highlights it (I'm running java scripts within Eclipse) driver.findElement(By.xpath("//button[contains(text(),'Save')]")).click(); My HTML code <button ...
2
votes
1answer
257 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=//...
3
votes
2answers
97 views

What is the best way to automate a system, where the XPath is not static?

I have to automate a system, which changes its ID's from time to time, and the XPath is not static. What is the best way to automate this kind of system?
0
votes
2answers
77 views

How can I use selenium to get the last element in a list?

I have such a structure How does it look visually I'm trying to get the last item and click on it, but the 4th item is selected. driver.findElement(By.xpath(("//*[@id=\"page-body\"]/div/div[2]/ul[...
0
votes
0answers
44 views

Problem facing to automate city auto suggested field when html structure is complex

I have tried many different XPATH but still I am not able fetch city from displayed list and perform click on it.I have posted this question earlier also suggested answers couldn't help.With my code ...
1
vote
2answers
60 views

What is the correct Xpath for this element?

I need to get the text inside the element and I am using Inner HTML, in Java Selenium but all the xpaths and css selectors written by me, are wrong, can you help me to get the right one please? Also ...
6
votes
6answers
17k views

How to write XPath if I have 'apostrophe' in my XPath element?

I came up in a situation where I have to identify an element using XPath and my element starts with apostrophe ('). I will give the example below. This is the usual way we write some XPath. By ...
1
vote
1answer
2k views

Selenium fail to find the html tag inside iframe after selecting the frame

I am trying to edit the message body area of outlook mail. The steps I have followed so far are, Login to outlook web app Double click and open the mail (the mail is opened in a seperate window) ...
0
votes
1answer
230 views

How to get src link using Selenium?

The task is simple: to extract the link of an audio of pronunciation for a word from a Yahoo Dictionary Webpage: e.g. Yahoo's Dictionary@ "real" Using "Chropath", I can locate the Xpath of the ...
0
votes
3answers
85 views

facing difficulty to create dynamic xpath for City field of UTest website

I am beginner in automation field, I am trying to automated one of the module, I have tried many different XPATH to fetch proper XPATH for City field o UTest site. Im trying to automate registration ...
1
vote
5answers
2k 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/...
0
votes
1answer
37 views

python dryscrape how to select child element

I'm working on a project with www.NJMLS.com. I'm try 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.cfm?...
0
votes
2answers
2k views

How to find a button using both xpath and button text?

I have three buttons withing a div. All three buttons belong to same class (class names are same). What I want to do is capture each button using its text (Buttons have different texts) and xpath of ...
1
vote
1answer
84 views

Unable to get the element using the text containing line break

I need to get the span element by matching its entire text which has a line break. Below is sample HTML: <div class="class1"> <a> <span>fourth<br>team</span>...
1
vote
1answer
48 views

Same Xpath expression returns different results

I understand that for the below xml the xpath expression "//span[position()=1]" returns the first span element anywhere in the document: <div> <span>qty</span> <span>price</...
0
votes
3answers
97 views

Unable to click on Xpath element even the correct path

Unable to click on Xpath element even the correct path,tried with Webdriver wait and Javascript executor still no use. My code: driver.findElement(By.xpath(".//*[text()='Next']")).click(); Page: &...
0
votes
0answers
65 views

Writing selenium tests againgst bootstrap Checkboxes

I have currently a big Problem to click on a Checkbox in a bootstrap designed GUI. In Html it appres like this: Does someone know how to press the Button of this checkbox? Because the controls are ...
1
vote
2answers
61 views

The xpath in selenium can not locate the path

I'm trying to add some text to a textbox in my html but the xpath cannot find the path and I don't know why. this is my code: PropertiesCollections.driver.FindElement(By.XPath("//*[@id='from0']"))....
0
votes
2answers
116 views

Selenium with Google search results

When you search for something in Google and get the results, it is not easy to locate the elements, using Selenium, since Google uses classes like <div class="kno-ecr-pt kno-fb-ctx gsmt"> ...
0
votes
1answer
37 views

Find element and click on it in a complex structure

I have following structure on my web-site. //New Box <div> <div> </div> <div> <div> <div> </div> <...
0
votes
2answers
558 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
vote
1answer
51 views

Scrape items from an HTML list

When Catalog receives a fragment for a book category, it seems to my eyes, to be just list items. For space, I didn't include that output. How can I ensure that only categories which belong to the ...
0
votes
1answer
91 views

Dynamic XPATH by for loop in selenium web driver

I'm trying to write dynamic XPATH by for loop in java selenium WebDriver but I couldn't do it. There's a webpage and I have to print the string content which are in the xpaths mentioned in follow. /...
0
votes
0answers
42 views

Verify links in article within the web page / selenium web driver

I have to verify the links mentioned in article within web page. There are too many links in the page but I have to verify just the links specified in the article content. https://techcrunch.com/2019/...