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 ...

learn more… | top users | synonyms

0
votes
2answers
51 views

Selenium is not recognizing xpath

When I attempt to search for the following element by xPath, Selenium does not find the the element. Not sure what I'm missing here. driver.FindElement(By.XPath("//input[@type='text']")).SendKeys("...
1
vote
2answers
37 views

What is the hierarchy to use for finding elements - ID, class, name, xpath?

What is the hierarchy to use 'find element' by ID, class, or xpath and so on. Which is preferred over which? For some elements class is being used - is that recommended?
1
vote
1answer
35 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 ?
3
votes
2answers
70 views

How to locate an element which is inside the iframe?

I'm new to automation testing (I'm using TestNG framework and Java language) I'm having trouble in locating an element which is inside iframe. WebElement iframeSwitch= driver.findElement(By.id("...
1
vote
1answer
31 views

How can I traverse to a particular element using xpath from a particular node? [closed]

Assume the following DOM fragment: <div id="ctl00_mainContent_ddl_destinationStation1_CTNR" class="search_options_menucontentbg" style="z-index: 999999; display: block;"> <div id="...
1
vote
3answers
49 views

Selenium- Unable to save dynamic paths in the list..list shows 0 as size

import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium....
0
votes
3answers
66 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 ...
1
vote
1answer
82 views

Firefinder doesn't find element but Firebug or Selenium IDE do

I have a problem with finding web elements in my web application. When I use Selenium IDE everything is ok, the element can be found. In Firebug or Chrome developer tools is ok as well (element is ...
2
votes
2answers
117 views

How to verify no /tr /td rows exist in a table?

I am verifying text using these Xpaths, $I->CanSeeElement("//tbody[contains(tr/td/div/table/tbody/tr/td[1]/text(),$this->Secondarycustomer)]"); $I->CanSeeElement("//tbody[contains(...
0
votes
0answers
84 views

How can I shorten the following Xpath

I am restricted to use ID. So that's why I am using Xpath without ID. This is what i am using as xpath and want to shorten it please help me. I have to find value of the following span- <span id=...
0
votes
2answers
79 views

Selecting element by xPath vs. class vs. byId

Selenium WebDriver provides numerous ways to select an element as shown in googledocs (under "implements interfaces"): by class name by id by xpath etc. Is there one that is more "resistant" (i....
1
vote
3answers
104 views

How to generate good locators for elements in Web pages?

This site contains many questions that are about finding the right locator expression (XPath, CSS, etc) for an object in WebPage or about troubleshooting problems related in invalid or dynamic ...
1
vote
6answers
233 views

How to find the xpath locator for logout button?

We are currently working on a selenium project. Can you guys help me to find the xpath locator for the logout button in the application? Below is a screenshot of the code for the element for which I'...
1
vote
1answer
37 views

What are the debug tools that i can use for GUI Automation on Internet Explorer?

Are there any tools similar to firebug/firepath that i can use to test the locators on the internet explorer browser? I was running an xpath which works in firefox but fails in IE.
1
vote
1answer
1k views

Can't click a button [Python + Selenium]

I'm writing a program to automate some actions on a website using Python and Selenium and I need to click a button with this code: <button class="button login" data-popup="login">Change User<...
2
votes
1answer
44 views

Assertion about size of an XML tag

Community, I'm trying to add an assertion for an XML Response that verifies the size of the info of one of the tags. So for example, this is my response: <description>This is your password</...
1
vote
2answers
203 views

AND/OR Operation in Contains Assertion in SOAP UI

There's one tag in my XML response whose elements (JSON Data) always come in different order. Is there any way to create a contains assertion with AND/OR operations or should I just use a Script ...
0
votes
3answers
539 views

Selenium Webdriver - finding element on IE 11

I'm trying to assert a 'name' on my page, to assure the right name is displayed: public static OpenQA.Selenium.By Name = (By.CssSelector("p")); Assert.AreEqual("Name", Global.driver.FindElement(...
2
votes
3answers
133 views

Correct CSS selector for selenium

Which css selector's correct for the following HTML code ? <li class="active editing" data-index="0"> <div class="view"> <input class="edit"/> </li> I'm trying to get ...
1
vote
1answer
1k views

How to use multiple condition in xpath?

I have tried with the xpath like "//HTMLtag[contains(text(),'Yourtext') and contains(text(),'Yourtext')]", but this case worked for the particular html tag and not for the different tags. how to make ...
2
votes
2answers
317 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 ...
5
votes
1answer
76 views

How to pull content of a div into a String

I am looking for a way to pull the html or text content of a so I could work with it for a method which validates links amongst text of messages displays on a webpage. I am using selenium and java. ...
2
votes
2answers
306 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
1answer
866 views

Using xpath to confirm <h4> text with a <strong tag> in the middle

I'm using the Java Selenium WebDriver implementation. I'm searching for a string literal in an tag which has a tag in the middle, i.e. <h4>Some regular text <strong>followed by strong ...
0
votes
1answer
70 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 ...
1
vote
2answers
83 views

Webdriver Java : How to identify two identical Ajax Control using xpath

WebApplication has Calender Ajax Control twice on same page. I cannot use id's as ids get generated by Ajax call dynamically . So identifying it using xpaths and classnames. I can identify First ...
1
vote
3answers
181 views

How to validate xpaths in selenium over scripts

I am new to Selenium. I heard that in real time we will not use xpaths generated by tools..rather we will write our own. So i decided to learn writing xpaths. Can u please suggest how to practice ...
0
votes
1answer
76 views

How to write xpath with variable?

I have an xpath: //*[@id='00QE000000gQ9fv_ACTION_COLUMN']/a[2]/span in this xpath 00QE000000gQ9fv is dynamic and _ACTION_COLUMN remains the same. I stored 00QE000000gQ9fv in a String variable as ...
1
vote
3answers
1k views

Finding grandparent of an element using xpath in selenium

I want to click the parent of an element if the text within the child matches a certain string. I am using contains to find the text and :xpath,"../../" to find the parent. Here is ruby code: test=@...
0
votes
2answers
191 views

How to get unique xpath with dynamic @id?

Hi I am facing problem to identify cause @id is dynamic :- //div[@id='SubmissionWizard:LOBWizardStepGroup:LineWizardStepSet:WC7LineCoverageScreen:WC7LineCoverageCV:WC7ConditionsDV:5:CoverageInputSet:...
0
votes
2answers
9k views

How to use Xpath 'contains()' function to locate a Web element in Selenium Webdriver?

I am a beginner in learning Selenium WebDriver and XPath. I am trying to get the "<td>" Element of the Nested Table which Contains string '7-8-9.' Following is the HTML page code: <!DOCTYPE ...
2
votes
2answers
91 views

Looking for a API/tool to validate html snippets

Our UI designers would like to validate that the HTML they specify should appear on a page does, in fact appear on the page as generated by a .jsp. They need to specify a particular set of HTML nodes ...
1
vote
4answers
1k views

How to work with changing element id in the html code

I am working in a ERP where the elements id are changing/rotating randomly. so if I am writing a code to locate a id, next time I run the selenium code it gets me error as the id changes by that time ...
0
votes
1answer
3k 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 ...
-1
votes
1answer
3k views

How to click on Canvas element?

How do I click on a Canvas element by using Selenium Web Driver and Java? I have searched Google but didn't find what I needed. A marker/pin is on the Google map and I have to click on the marker/pin....
0
votes
3answers
172 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
1answer
472 views

Find text using Xpath with class (vb.net)

Hey guys ! This is on what I'm working on : Dim url As String = "http://brayket.byethost9.com/index.php?/shoutbox/" Dim web As New HtmlWeb() Dim doc As HtmlDocument = web.Load(url) Dim ...
0
votes
2answers
805 views

XPath not recognised in page object model in WebDriver [closed]

xpath not recognised in page object model in webdriver. @FindBy(xpath = "//td[contains (text(),'xxx')]") public WebElement topMenu; topMenu.click(); Error: Unable to locate element: {"method":...
1
vote
1answer
695 views

Parsing xpath results in selenium ide

I'm trying to get a list of all the links that follow a certain rule ( their href is Downloads.aspx?<somestring> ) *Note: I'm using Selenium IDE, the Firefox plugin for this. In order to get ...
3
votes
2answers
8k views

How can I dynamically create an xpath string in Python for a webdriver xpath selector?

I am writing a Selenium Webdriver test using python2.7 to use xpath to select a link node set. For each link I need to change the href attribute using driver.execute_script to execute javascript. ...
1
vote
1answer
172 views

How to locate cursors randomly in a map?

There is a lot of cursors in the map. Every time you refresh the map you will get another different cursors with different IDs, o I can't use the IDs. I want to click at any cursor, a tooltip should ...
1
vote
3answers
3k views

How to handle dynamically updated params in XPath queries in Selenium?

I am new to Selenium IDE. In my Web application, while playing back the recorded events, some internal id in XPath expression gets changed dynamically. E.g.: (//*[@id='edit_1_undefined']) in this ...
2
votes
1answer
641 views

select random cursors on map using selenium ide

I'm using google map api in my site and I want to test the cursors on map using Selenium IDE. Now I use this code and it works fine: clickAt > xpath=(//map[@id='gmimap85']) but it tests only one ...
3
votes
1answer
3k views

How to indicate an `&nbsp;` in xpath?

Say we have the following HTML code. What I want is to locate to the label element whose text is 'AgendaShowCapacity (1 remaining)' with XPath. <div id="pageContent"> <fieldset> &...
2
votes
2answers
16k views

"Element is no longer attached to the DOM” StaleElementReferenceException when selecting HTML table row

I am using Selenium 2/WebDriver for automation. I have a table and am trying to select a row in it. When the test runs, I can see the row become highlighted as if it is clicked, but then immediately I ...
3
votes
4answers
2k views

Xpath captured using Selenium IDE is not running in Selenium RC for Links designed in XML

The below xpath which is captured for links in selenium IDE is not running in Selenium RC. The links are designed in XML. selenium.ClickAt("xpath=/html/body/div/div[2]/ul/li[3]", ""); selenium....
1
vote
4answers
4k views

absolute Xpath is not working for Gmail login page

I have tested the Gmail login page and was trying to verify the Sign in label in the Gmail login page above the user name field. I am using FirePath to generate the Xpath. When I inspect the element ...
2
votes
2answers
648 views

Not able to identify tab in Selenium

Below is code for tab - account.This is third tab. I have to go on tab but I am not able to identify <td class="buttons" nowrap="nowrap" title="Shows data of bank account" onclick="document....
2
votes
5answers
9k views

Cannot locate button with changing ID in Selenium

I am working on a project where I have to locate a button. I have used XPath for that, but the button's id changes on every refresh, so I am facing a problem with that. Below is a HTML excerpt. Let me ...
14
votes
2answers
42k views

WebDriver: find elements by text

I know that WebDriver can locate links through their text, using find_element_by_link_text or find_element_by_partial_link_text. Is it possible to locate any element (such as li, div, span, ...) by ...