History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-357
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Andras Hatvani
Reporter: Parv
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

getXPathCount() not working

Created: 28/Sep/07 03:52 PM   Updated: 03/Nov/08 12:56 PM
Component/s: Client Driver - Ruby
Affects Version/s: 0.9.2
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: selenium server 0.9.2, IE 6, Windows xp, ruby 1.85.26
Issue Links:
Relationship
 
This issue Relates to:
SRC-498 getXpathCount method is not working Minor Closed


 Description  « Hide
Used the same (exact) locator for both a check() and get_xpath_count(), i was able to successfully click the element, but the get_xpath_count() return 0. See below:

puts $sel.get_xpath_count("//div[@id='contentzone']/div[2]/div/div/table/tbody/tr[1]/td/div/input") --> output is 0
$sel.check("//div[@id='contentzone']/div[2]/div/div/table/tbody/tr[1]/td/div/input") --> able to set the radio

 All   Comments   Work Log   Change History      Sort Order:
Andras Hatvani - 27/Aug/08 10:52 AM
Is this issue still present when trying with the latest beta and/or nightly build?

Bill - 24/Oct/08 05:23 AM
I also have this issue on IE 7, I'm using selenium server beta 1 (have also tried the latest nightly) with C# driver.

Using an actual xpath query count() outside of selenium on //div[@id='TreeView1']/ul/li returns me 7 elements, however running this in selenium like so

selenium.GetXpathCount("//div[@id='TreeView1']/ul/li") - The output is 0

But selenium will happily click one of these elements inside the tree by index eg:

selenium.Click("//div[@id='AlterianTreeView1']/ul/li[5]/div/span[2]") - works absolutely fine.

Andras Hatvani - 30/Oct/08 05:03 PM
Please keep in mind that as long as you don't provide a reproducible test case no action can be taken.
My test was successful with the following parameters:

Client driver: Java
OS: OS X 10.5.5
Browser: Firefox
Test:
Launcher: *chrome
Base URL: http://www.google.at"

selenium.open("http://www.google.at");
assertEquals(selenium.getXpathCount("//div[contains(@id,'gb')]"), 2); // <- true

Please execute your test with a browser other than IE and provide your launcher type, too.

Andras Hatvani - 03/Nov/08 12:56 PM
With the before mentioned configuration:
selenium.getXpathCount("/html/body/div[@id='gbar']/nobr/div[@id='gbi']/*") // <- correctly returns 11
I suggest trying to use the faster optional javascript-xpath library instead of google's ajaxslt as this is the library used in IE, because it has no native XPath engine, so I assume that the issue can be caused by the library.