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
2answers
43 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
3answers
697 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
3answers
565 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
1answer
187 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 ...
0
votes
1answer
46 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
1answer
411 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
3answers
2k views

How to find element with li class inside span class in Selenium

Its name of tab. I have tried by Link-text but it's not working. I have tried d.findElement(By.linkText("Clauses")).click(); It shows error Exception in thread "main" org.openqa.selenium....
0
votes
1answer
109 views

xPath (SCRAPY) Python using two attributes together

For example : <html > <body> <a class="abcd" title="he is Gandhi"> he was good </a> <a class="bcde" > he was very good </a> <a class="abcde" title ...
0
votes
1answer
47 views

Tidy HTML with BaseX

How do I tidy this HTML for baseX? Working from a basic example. Looks like the HTML isn't valid, or at least baseX has apparent problems with parsing it: thufir@dur:~/NetBeansProjects/...
0
votes
1answer
383 views

xpath query for specific String value

My project is crashing with: Element info: {Using=xpath, value=//a[contains(text(), 'Books')]/@href}. The output (crash): thufir@dur:~/NetBeansProjects/com.toscrape.books.selenium$ thufir@dur:~/...
0
votes
2answers
647 views

Selenium: Why find_element_by_partial_link_text finds the first match only?

What I want to do: I want to click all the links where partial text = "105611A5C7B9_Logs_" Example: First Link Text = 105611A5C7B9_Logs_11-15-18-06-04PM.tgz Second Link Text = ...
0
votes
2answers
206 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: ...
0
votes
1answer
3k views

How to resolve InvalidSelectorException in Selenium?

selenium.common.exceptions.InvalidSelectorException: Message: invalid selector Unable to locate an element with the xpath expression .//*[@id="Toolbar"]/table/tbody/tr/td[2]/a[1]/span)[3] because of ...
0
votes
2answers
294 views

Verify Text using CSS or Xpath

I am new to automation, Selenium Web Driver and am practicing code using Amazon. I want to verify my logged in user name (Hello, Nichole) on the Amazon Home Page but anything I enter using CSS or ...
0
votes
1answer
3k views

Getting Invalid Element State Exception

I am trying to clear text from <div> section using XPath using the below line. Clear Element Text xpath=//*[@id="intro-overlay"]/div I am getting below Error: ...
0
votes
1answer
7k views

How do I use find_elements_by_xpath to only get some elements in python selenium?

How should I use driver.find_elements_by_xpath() to get all the data-row elements that I boxed in the picture. I do not need the other tr tags. In my current code I just check all the tr tags and ...
0
votes
1answer
4k views

How to create an Xpath for a checkbox?

I've tried the following xpath but none of them work. The id is listed differently everytime. Next to the checkbox is this word " poetin alfa" - //input[@type='checkbox'][@value='on'] - //*[@id='id1'...
0
votes
2answers
367 views

Couldn't find the x path of filter in selenium webdriver

Tried this: WebElement searchDropdown = driver.findElementByXPath("//span[@class='selected']"); Select searchFilter = new Select(searchDropdown); searchFilter.selectByVisibleText("...
0
votes
4answers
2k 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
45 views

Xpath worked during script creation not working when replaying

HTML Tag: <a href="/candidate/updateprofile.html"> <span class="no-of-jobs">100%</span> <span class="grey-text">Profile Strength</span> Update your profile &...
0
votes
1answer
176 views

SoapUI Xpath assertion: match the exact length of the field

I need to match, exact length of a string and I'm using below code for that : declare namespace ns123='urn:lt:sb:xmlns:services:customers:customerinformationfile:GetCustByGlobalId:1.2'; matches(//...
0
votes
2answers
4k views

Dynamic ID locating element [duplicate]

New to Automation , I am using selenium with JAVA. I have come across a stumbling block our developers do not assign ID to our elements and JFS assigns it own ID , however the ID's are dynamic and ...
0
votes
2answers
2k views

Selenium — Unable to click the checkbox, error throws Element not visible

This is my html source: <div class="col s12"> <input type="checkbox" class="filled-in" d="corresp-checkbox" data-class="jrnlCorrRef" data-note- class="jrnlCorrAff" ...
0
votes
2answers
252 views

Unable to click image in Wordpress text editor

A test case where image and content are to be added in WP text editor under post section. I want to select the image that is uploaded in the editor but it always says "Unable to locate element" ...
0
votes
1answer
44 views

Can someone help me to correct this date picker excerpt [closed]

I need help to correct this excerpt. The excerpt is not working right now. I have attached the screen shot here. //h3[text()='Alert Expiration']/..//table[contains(@class,'vdl-calendar__grid') and ...
0
votes
1answer
3k views

How to find element with find_element_by_xpath multiple names selenium

I'm looking for a site where the name of the ID depends on some variables that I can't control. So the ID can either be "sub_allGoods_4", "sub_allGoods_12" or whatever number: find_element_by_xpath('...
0
votes
1answer
3k views

No such element exception while handling elements inside tables in Selenium Webdriver

I'm trying to access a select HTML element using Selenium WebDriver. But I'm getting a org.openqa.selenium.NoSuchElementException. This is happening only while handling elements inside a table. ...
0
votes
2answers
555 views

XPath of an element keeps changing when testing in different OS or device

Me and my team sometimes experienced this issue when testing one Cucumber feature in: different version of Android and iOS different device with same OS version. This really slowing us down ...
0
votes
1answer
331 views

JMeter - unable to return correct argument from list in XPath extractor

In order to generate HTTP requests to open a particular window, I need to obtain the component ID which is nested as an argument in onmousedown="Console.openView()" - in this example componentId= 1325....
0
votes
3answers
2k views

How to handle selectors that have ID's that keep changing? [duplicate]

I am using Fire bug in firefox browser to identify a unique id in the web pages using the Xpath feature. Sometimes the Xpaths are not unique, ie: the xpath id is dynamic and keeps changing as the ...
0
votes
1answer
125 views

Finding column with certain text works using xpath but fails with cssSelector

I was trying to locate table column containing text 'Name', and it fails while using cssSelector with 'Unable to locate element' but works with XPath. I tried all the 3 below options with different ...
0
votes
1answer
8k views

In WebDriver I need to locate a text that's sibling to a tag

I am using WebDriver and I need to use XPath to get the text that appears after the <br></br> which is "59Min" from the below HTML. <div> 2Hrs, 56Min <br></br> 59Min ...
0
votes
3answers
213 views

how to use xpath for the following case

.//*[@id='colDiv_Apr282014']/div[5]/div[1] .//*[@id='colDiv_Apr282014']/div[9]/div[1] .//*[@id='colDiv_Apr282014']/div[11]/div[1] In the xpath above, you can see the value inside the first div-is ...
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
27 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
82 views

Why doesn't my XPath find my element on the page?

I am trying to retrieve the content of the header and each chapter which is a repetitive structure as you can see below. For this am using Selenium and C#. My attempt, using xpath, is this: string ...
0
votes
2answers
101 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
0answers
283 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
1answer
33 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. ...
0
votes
1answer
114 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
2answers
522 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
1answer
79 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
0answers
46 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 ...
0
votes
2answers
92 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, ...
0
votes
1answer
2k 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
1answer
71 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....
0
votes
0answers
45 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/...
0
votes
4answers
696 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
2answers
325 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
2answers
208 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 ...