Hi All,

I've been looking at the possibility of using css selectors instead of
XPath to cure the IE performance problems.

To do this I copied some Tellurium generated xpath expressions into a
Selenium test, then translated these into css syntax as follows:

XPath syntax
sel.isElementPresent("//descendant-or-self::*/descendant-"+
        "or-self::tab...@id='MVContentPredictionsTable']/tbody/tr[child::td]
[8]/td[7]/des"+
        "cendant-or-self::*");

sel.getText("//descendant-or-self::*/descendant-"+
        "or-self::tab...@id='MVContentPredictionsTable']/tbody/tr[child::td]
[8]/td[7]/des"+
        "cendant-or-self::*");

css syntax
sel.isElementPresent("css=#MVContentPredictionsTable > tbody > tr:nth-
child(8) > td:nth-child(7)");

sel.getText("css=#MVContentPredictionsTable > tbody > tr:nth-child(8)
> td:nth-child(7)");

When run in IE7 the selenium server output was as follows:

16:56:39.644 INFO - Command request: isElementPresent[//descendant-or-
self::*/de
scendant-or-self::tab...@id='MVContentPredictionsTable']/tbody/tr
[child::td][8]/
td[7]/descendant-or-self::*, ] on session
8e11e0ad889c472ca23475694039ec58
16:56:48.861 INFO - Got result: OK,true on session
8e11e0ad889c472ca23475694039ec58
16:56:48.861 INFO - Command request: getText[//descendant-or-self::*/
descendant-
or-self::tab...@id='MVContentPredictionsTable']/tbody/tr[child::td][8]/
td[7]/des
cendant-or-self::*, ] on session 8e11e0ad889c472ca23475694039ec58
16:56:58.700 INFO - Got result: OK,2 on session
8e11e0ad889c472ca23475694039ec58

16:56:58.700 INFO - Command request: isElementPresent
[css=#MVContentPredictionsT
able > tbody > tr:nth-child(8) > td:nth-child(7), ] on session
8e11e0ad889c472ca
23475694039ec58
16:57:00.954 INFO - Got result: OK,true on session
8e11e0ad889c472ca23475694039e
c58
16:57:00.954 INFO - Command request: getText
[css=#MVContentPredictionsTable > tb
ody > tr:nth-child(8) > td:nth-child(7), ] on session
8e11e0ad889c472ca234756940
39ec58
16:57:02.803 INFO - Got result: OK,2 on session
8e11e0ad889c472ca23475694039ec58

So the XPath statements took a total of 19 seconds to execute, while
the css statements took 4 seconds.
The css syntax probably won't work in IE6, but are fine in IE7 and FF3
and Safari.

>From this it would appear that it is not too difficult to directly
translate XPath statements into css, and therefore it should be
possible to use the same Tellurium UI object definitions for css or
XPath.

Comments anyone?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to