Hello,
I understand that IEDriverServer.exe contains a JS implementation of JS
that gets injected in IE
Let me give a short example of it failing


HTML:
====================
<html>
<head><title>Selenium test document</title></head>
<body>
<div id="my-div-id" class="TEST_DIV">
<ul class="TEST_UL">
<li class="list-menu-li"><a href="#">link 1</a></li>
</ul>
</div>
<div class="quad-dropdown-menu another" style='display: block;
visibility: visible; bugabilitu: gobo'>
</div>
</body>
</html>
=================
In IE8 on Windows XP the following XPath expression does not find element:
driver.findElementByXPath("//div[@id='my-div-id']/ul/li[@class='list-menu-li']")
while the equivalent works:
driver.findElementByXPath("//div[@id='my-div-id']/ul/li[./@class='list-menu-li']")

Additionally - it seems that properties inside style get capitalized for
known properties:
driver.findElementsByXPath("//div[contains(@class,'quad-dropdown-menu') and
(contains(@style, 'DISPLAY: block') or contains(@style,'VISIBILITY:
visible') )]");
The selector stops working if I use
(contains(@style, 'display: block') or contains(@style,'visibility:
visible') )


We have written thousands of XPath selectors that work in FF but due to the
reasons above stop working in IE

Is there a way to sidestep this issue? Are these bugs in the used library:
http://code.google.com/p/wicked-good-xpath/ - so should I report them
upstream?

Kind regards:
al_shopov

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/mD0GhaEhgjMJ.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Mark Collin at Nov 26, 2012 at 10:33 pm
    My top tips if always use contains for classes in IE, so change:



    driver.findElementByXPath("//div[@id='my-div-id']/ul/li[@class='list-menu-li
    ']")



    to



    driver.findElementByXPath("//div[@id='my-div-id']/ul/li[contains(@class,'lis
    t-menu-li')]")



    IE tends to get extra classes added to things to make IE look like other
    browsers, the first XPath will only find something assigned a specific
    class, the second one will get around that problem.





    From: selenium-users@googlegroups.com
    On Behalf Of Alexander Shopov
    Sent: 26 November 2012 17:36
    To: selenium-users@googlegroups.com
    Subject: [selenium-users] XPath particularities with IE



    Hello,
    I understand that IEDriverServer.exe contains a JS implementation of JS that
    gets injected in IE
    Let me give a short example of it failing


    HTML:
    ====================
    <html>
    <head><title>Selenium test document</title></head>
    <body>
    <div id="my-div-id" class="TEST_DIV">
    <ul class="TEST_UL">
    <li class="list-menu-li"><a href="#">link 1</a></li>
    </ul>
    </div>
    <div class="quad-dropdown-menu another" style='display: block;
    visibility: visible; bugabilitu: gobo'>
    </div>
    </body>
    </html>
    =================
    In IE8 on Windows XP the following XPath expression does not find element:
    driver.findElementByXPath("//div[@id='my-div-id']/ul/li[@class='list-menu-li
    ']")
    while the equivalent works:
    driver.findElementByXPath("//div[@id='my-div-id']/ul/li[./@class='list-menu-
    li']")

    Additionally - it seems that properties inside style get capitalized for
    known properties:
    driver.findElementsByXPath("//div[contains(@class,'quad-dropdown-menu') and
    (contains(@style, 'DISPLAY: block') or contains(@style,'VISIBILITY:
    visible') )]");
    The selector stops working if I use
    (contains(@style, 'display: block') or contains(@style,'visibility:
    visible') )


    We have written thousands of XPath selectors that work in FF but due to the
    reasons above stop working in IE

    Is there a way to sidestep this issue? Are these bugs in the used library:
    http://code.google.com/p/wicked-good-xpath/ - so should I report them
    upstream?

    Kind regards:
    al_shopov

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/mD0GhaEhgjMJ.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Alexander Shopov at Nov 27, 2012 at 11:41 am

    Thank you Mark, the problem was elsewhere. When you say:
    IE tends to get extra classes added to things to make IE look like other
    browsers
    Do you mean that IE itself adds more classes or that developers usually add
    additional classes to IE to make it similar in behavior to other browsers?
    Kind regards:
    al_shopov

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/g2IHpEcX_nQJ.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedNov 26, '12 at 6:33p
activeNov 27, '12 at 11:41a
posts3
users2
websiteseleniumhq.org

2 users in discussion

Alexander Shopov: 2 posts Mark Collin: 1 post

People

Translate

site design / logo © 2022 Grokbase