<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Selenium UI-Element Locator</title>
	<atom:link href="http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/feed/" rel="self" type="application/rss+xml" />
	<link>http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/</link>
	<description>from the seeds of gyrm</description>
	<lastBuildDate>Wed, 25 May 2011 12:10:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Manu V Gorur</title>
		<link>http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/comment-page-1/#comment-23811</link>
		<dc:creator>Manu V Gorur</dc:creator>
		<pubDate>Wed, 25 May 2011 12:10:54 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/#comment-23811</guid>
		<description>Its an interesting document but Using XPath in Selenium automation application is time consuming and unstable and will take a lot of our development and debugging time to determine stable or unique UI locator path.

Justification:
Testing Static Content is the first and foremost test procedure to check the existence of a static, non-changing, UI element in any Selenium test automation. This mechanism used in test automation for improving the maintenance and extensibily of your automation suite. This is taken into account as a Selenium Test Design Considerations which is mentioned in the official SeleniumHQ website.

http://seleniumhq.org/docs/06_test_design_considerations.html

Choosing a Location Strategy:

There are multiple ways of selecting an UI object on a page. But what is the trade offs of each of these locator types? We can locate an object using mechanisms mentioned below:
•	the element’s ID 
•	the element’s NAME attribute 
•	an XPath statement 
•	by a links text 
•	document object model (DOM)
Using an element ID or name locator is the most efficient in terms of test performance, and also makes your test code more reliable; if the ID or name within the page source is well-named. 

Selenium supports several locators, of which XPaths are the most expressive of them all.

XPath statements take longer time to process since the browser must run its XPath processor.

 Xpath has been known to be especially very slow and some time it’s may not work in Internet Explorer version 7. Which in turn cause Element not found Exception and fails many of our test cases due to this reason.

Xpath are very slow in IE especially in multi-window mode (which is Selenium’s default mode).
To use Selenium in single-window mode, just start selenium with the -singleWindow flag. But In single window mode, the difference was lesser at IE 8 being somewhere around 2-3 times slower. Single-window didn’t work for several situations in the application. For instance we would loose the session in the popup window in some situations or the JavaScript on the page interfered with Selenium’s js and a few other problems. For this reason we couldn’t use it.
As described in the document focused on Selenium locators, there are other alternatives to XPaths that are faster. If we can use id and name attributes, that would be a great option.
CSS and DOM would work for a larger set of cases; however, it can’t be used for all the elements either. Going back to our situation, several elements we needed to target happened to have ids but they were dynamically generated and so we couldn’t use it with Selenium’s out-of-the box capabilities.

Cheers,
Manu V Gorur</description>
		<content:encoded><![CDATA[<p>Its an interesting document but Using XPath in Selenium automation application is time consuming and unstable and will take a lot of our development and debugging time to determine stable or unique UI locator path.</p>
<p>Justification:<br />
Testing Static Content is the first and foremost test procedure to check the existence of a static, non-changing, UI element in any Selenium test automation. This mechanism used in test automation for improving the maintenance and extensibily of your automation suite. This is taken into account as a Selenium Test Design Considerations which is mentioned in the official SeleniumHQ website.</p>
<p><a href="http://seleniumhq.org/docs/06_test_design_considerations.html" rel="nofollow">http://seleniumhq.org/docs/06_test_design_considerations.html</a></p>
<p>Choosing a Location Strategy:</p>
<p>There are multiple ways of selecting an UI object on a page. But what is the trade offs of each of these locator types? We can locate an object using mechanisms mentioned below:<br />
•	the element’s ID<br />
•	the element’s NAME attribute<br />
•	an XPath statement<br />
•	by a links text<br />
•	document object model (DOM)<br />
Using an element ID or name locator is the most efficient in terms of test performance, and also makes your test code more reliable; if the ID or name within the page source is well-named. </p>
<p>Selenium supports several locators, of which XPaths are the most expressive of them all.</p>
<p>XPath statements take longer time to process since the browser must run its XPath processor.</p>
<p> Xpath has been known to be especially very slow and some time it’s may not work in Internet Explorer version 7. Which in turn cause Element not found Exception and fails many of our test cases due to this reason.</p>
<p>Xpath are very slow in IE especially in multi-window mode (which is Selenium’s default mode).<br />
To use Selenium in single-window mode, just start selenium with the -singleWindow flag. But In single window mode, the difference was lesser at IE 8 being somewhere around 2-3 times slower. Single-window didn’t work for several situations in the application. For instance we would loose the session in the popup window in some situations or the JavaScript on the page interfered with Selenium’s js and a few other problems. For this reason we couldn’t use it.<br />
As described in the document focused on Selenium locators, there are other alternatives to XPaths that are faster. If we can use id and name attributes, that would be a great option.<br />
CSS and DOM would work for a larger set of cases; however, it can’t be used for all the elements either. Going back to our situation, several elements we needed to target happened to have ids but they were dynamically generated and so we couldn’t use it with Selenium’s out-of-the box capabilities.</p>
<p>Cheers,<br />
Manu V Gorur</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shytian</title>
		<link>http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/comment-page-1/#comment-14611</link>
		<dc:creator>shytian</dc:creator>
		<pubDate>Mon, 10 Jan 2011 07:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/#comment-14611</guid>
		<description>Do you have ways to support unicode? Such as I define a link by &#039;locator link=xxx &#039;,xxx means unicode characters.</description>
		<content:encoded><![CDATA[<p>Do you have ways to support unicode? Such as I define a link by &#8216;locator link=xxx &#8216;,xxx means unicode characters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stella</title>
		<link>http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/comment-page-1/#comment-13439</link>
		<dc:creator>stella</dc:creator>
		<pubDate>Mon, 13 Dec 2010 06:57:39 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/#comment-13439</guid>
		<description>my email is pipi3891@qq.com thank you very much!!!</description>
		<content:encoded><![CDATA[<p>my email is <a href="mailto:pipi3891@qq.com">pipi3891@qq.com</a> thank you very much!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stella</title>
		<link>http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/comment-page-1/#comment-13438</link>
		<dc:creator>stella</dc:creator>
		<pubDate>Mon, 13 Dec 2010 06:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/#comment-13438</guid>
		<description>would you please send me the ui-element.js and ui-map-element.js files</description>
		<content:encoded><![CDATA[<p>would you please send me the ui-element.js and ui-map-element.js files</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bcw</title>
		<link>http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/comment-page-1/#comment-8807</link>
		<dc:creator>bcw</dc:creator>
		<pubDate>Mon, 21 Dec 2009 23:11:29 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2007/05/12/selenium-ui-element-locator/#comment-8807</guid>
		<description>Oh, you meant &quot;READ THIS FIRST&quot; BEFORE anything else, such as posting dumb questions.  I get it now.

Now, why didn&#039;t I think of that?

Sorry, mate.  I&#039;ll probably have some more questions after I try making a map file for our app (lots of jQuery and whatever custom controls our team grabs each day...).

Cheers,
bcw</description>
		<content:encoded><![CDATA[<p>Oh, you meant &#8220;READ THIS FIRST&#8221; BEFORE anything else, such as posting dumb questions.  I get it now.</p>
<p>Now, why didn&#8217;t I think of that?</p>
<p>Sorry, mate.  I&#8217;ll probably have some more questions after I try making a map file for our app (lots of jQuery and whatever custom controls our team grabs each day&#8230;).</p>
<p>Cheers,<br />
bcw</p>
]]></content:encoded>
	</item>
</channel>
</rss>

