Xpath blow up IE but Firefox works fine

88 views
Skip to first unread message

robocop

unread,
Jan 31, 2013, 10:49:53 AM1/31/13
to seleniu...@googlegroups.com
Hi,

I seem to have a problem with below xpath in IE8 vs Firefox18 on selenium webdriver. Essentially the xpath cause IE to stop working and closes down with s but Firefox it works perfectly. It seems that is just does not like me searching in private parts, good old microsoft. any help would be appreciated

public int getXPathCount(String sLocator, WebDriver dr) {
        return dr.findElements(By.xpath(sLocator)).size();
    }


int xpathcount=getXPathCount("//a[contains(@name,'node')]",driver);
        System.out.println(xpathcount)

Michael Wowro

unread,
Feb 1, 2013, 6:42:10 AM2/1/13
to seleniu...@googlegroups.com
Hi robocop,

I can't say anything about your special case, but (slightly) differences in XPath-behaviour between different browser drivers are inherent when using Selenium: http://seleniumhq.org/docs/03_webdriver.jsp#by-xpath As you can see in the table, IE doesn't have a native xpath engine ...

Yours Michael

NaveenKumar Reddy R

unread,
Feb 1, 2013, 6:46:20 AM2/1/13
to seleniu...@googlegroups.com
HI,

   Did you get any error in IE?

Regards
Naveen Kumar Reddy R


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/Mgtu8LopsaUJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

robocop

unread,
Feb 1, 2013, 10:01:31 AM2/1/13
to seleniu...@googlegroups.com, navi...@gmail.com
Hi,

Only a sporadic message to do with data protection or something?

Thanks

robocop

unread,
Feb 1, 2013, 10:02:54 AM2/1/13
to seleniu...@googlegroups.com, navi...@gmail.com
Hi,

How to you test if an xpath actually finds the elements like for example firebug?

thanks

robocop

unread,
Feb 4, 2013, 4:41:01 AM2/4/13
to seleniu...@googlegroups.com, navi...@gmail.com
Hi,

Yes it finds the element and also run perfectly in Firefox, whereas in IE in just blows up and IE  stops responding. Sometime I get an warning about data execution prevention so I turned this off but to no avail

in firefox it returns 589 which is correct so granted it goes through a lot of nodes but again do not know how to resolve this. Overall it is painful that one cannot verify xpaths on IE as it make the whole process annoying.


thanks
Reply all
Reply to author
Forward
0 new messages