<?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 RC Per-Session Extension Javascript</title>
	<atom:link href="http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/</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: Sybren</title>
		<link>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/comment-page-1/#comment-10079</link>
		<dc:creator>Sybren</dc:creator>
		<pubDate>Mon, 23 Aug 2010 08:40:12 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/#comment-10079</guid>
		<description>I worked out a solution, check out my blog at http://stuvel.eu/archive/131/extending-selenium-from-the-client-driver for more information.</description>
		<content:encoded><![CDATA[<p>I worked out a solution, check out my blog at <a href="http://stuvel.eu/archive/131/extending-selenium-from-the-client-driver" rel="nofollow">http://stuvel.eu/archive/131/extending-selenium-from-the-client-driver</a> for more information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sybren</title>
		<link>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/comment-page-1/#comment-10023</link>
		<dc:creator>Sybren</dc:creator>
		<pubDate>Thu, 19 Aug 2010 14:35:40 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/#comment-10023</guid>
		<description>I&#039;ve tried to extend the Selenium locators using the per-session extension script, and that also fails. I&#039;ve posted a question about this on the selenium-users mailing list at http://groups.google.com/group/selenium-users/browse_thread/thread/4469b18f8909f2d

I&#039;ll post back here when I get an answer on the list.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve tried to extend the Selenium locators using the per-session extension script, and that also fails. I&#8217;ve posted a question about this on the selenium-users mailing list at <a href="http://groups.google.com/group/selenium-users/browse_thread/thread/4469b18f8909f2d" rel="nofollow">http://groups.google.com/group/selenium-users/browse_thread/thread/4469b18f8909f2d</a></p>
<p>I&#8217;ll post back here when I get an answer on the list.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross Patterson</title>
		<link>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/comment-page-1/#comment-8923</link>
		<dc:creator>Ross Patterson</dc:creator>
		<pubDate>Fri, 19 Feb 2010 13:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/#comment-8923</guid>
		<description>Just a heads-up for anyone trying to use this SetExtensionJS() interface.  You can&#039;t use this to create a Selenium command like you can with user-extensions.js, because the code that registers command handlers is run before SetExtensionJS() injects your code.</description>
		<content:encoded><![CDATA[<p>Just a heads-up for anyone trying to use this SetExtensionJS() interface.  You can&#8217;t use this to create a Selenium command like you can with user-extensions.js, because the code that registers command handlers is run before SetExtensionJS() injects your code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gyrm</title>
		<link>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/comment-page-1/#comment-8701</link>
		<dc:creator>gyrm</dc:creator>
		<pubDate>Fri, 09 Oct 2009 04:10:19 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/#comment-8701</guid>
		<description>@ikostenko: I believe the strange behavior you&#039;re seeing is due to your new Selenium command not following the semantics for the different &quot;types&quot; of commands, i.e. &quot;actions&quot; and &quot;accessors&quot;. Actions are named starting with &quot;do&quot;, while accessors are named starting with &quot;get&quot;. You can see in selenium-commandhandlers.js that the two are registered differently (look for &lt;code&gt;_registerAllAccessors&lt;/code&gt; compared to &lt;code&gt;_registerAllActions&lt;/code&gt;).

I think the return value of the command is used differently, depending on the type of command. Since you&#039;re interested in actually returning a value (and not a condition closure or null), you probably want to use &quot;getElement&quot; instead of &quot;doReturnElement&quot;.

Hope it works out for you.</description>
		<content:encoded><![CDATA[<p>@ikostenko: I believe the strange behavior you&#8217;re seeing is due to your new Selenium command not following the semantics for the different &#8220;types&#8221; of commands, i.e. &#8220;actions&#8221; and &#8220;accessors&#8221;. Actions are named starting with &#8220;do&#8221;, while accessors are named starting with &#8220;get&#8221;. You can see in selenium-commandhandlers.js that the two are registered differently (look for <code>_registerAllAccessors</code> compared to <code>_registerAllActions</code>).</p>
<p>I think the return value of the command is used differently, depending on the type of command. Since you&#8217;re interested in actually returning a value (and not a condition closure or null), you probably want to use &#8220;getElement&#8221; instead of &#8220;doReturnElement&#8221;.</p>
<p>Hope it works out for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ikostenko</title>
		<link>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/comment-page-1/#comment-8687</link>
		<dc:creator>ikostenko</dc:creator>
		<pubDate>Tue, 22 Sep 2009 13:15:47 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/#comment-8687</guid>
		<description>Sorry to post the following here, but I could not send you a message from clearspace.openqa.org due to their technical problems.

I have a problem with extending Selenium with a new command which returns something - it fails with &#039;this.waitForCondition is not a function&#039; exception.

Below are my settings:

1. selenium-server.jar - user-extensions.js:

Selenium.prototype.doReturnElement = function(element) {
     return this.browserbot.findElement(element);
};


2. selenium-java-client-driver.jar - Selenium.java
...
void returnText (String text);
...

DefaultSelenium.java
...
public void returnElement(String element) {
        commandProcessor.doCommand(&quot;returnElement&quot;, new String[] {element});
}
...

3. MyTest.java:

...
public void testValidElement() {
     selenium.returnElement(&quot;//a&quot;);
}

public void testInvalidElement() {
     selenium.returnElement(&quot;invalid&quot;);
}
...

When running the test, different exceptions are thrown:

1. In case of non-existing element:
com.thoughtworks.selenium.SeleniumException: ERROR: Element invalid not found
	at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
	at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
	at com.thoughtworks.selenium.DefaultSelenium.returnElement(DefaultSelenium.java:743)
	at MyTest.testInvalidElement(MyTest.java)
	
	
2. In case of existing element:
com.thoughtworks.selenium.SeleniumException: this.waitForCondition is not a function
	at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
	at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
	at com.thoughtworks.selenium.DefaultSelenium.returnElement(DefaultSelenium.java:743)
	at MyTest.testValidElement(MyTest.java)

The latter exception is also thrown when the doReturnElement simply returns a string.

Thank you very much in advance,
Irina</description>
		<content:encoded><![CDATA[<p>Sorry to post the following here, but I could not send you a message from clearspace.openqa.org due to their technical problems.</p>
<p>I have a problem with extending Selenium with a new command which returns something &#8211; it fails with &#8216;this.waitForCondition is not a function&#8217; exception.</p>
<p>Below are my settings:</p>
<p>1. selenium-server.jar &#8211; user-extensions.js:</p>
<p>Selenium.prototype.doReturnElement = function(element) {<br />
     return this.browserbot.findElement(element);<br />
};</p>
<p>2. selenium-java-client-driver.jar &#8211; Selenium.java<br />
&#8230;<br />
void returnText (String text);<br />
&#8230;</p>
<p>DefaultSelenium.java<br />
&#8230;<br />
public void returnElement(String element) {<br />
        commandProcessor.doCommand(&#8220;returnElement&#8221;, new String[] {element});<br />
}<br />
&#8230;</p>
<p>3. MyTest.java:</p>
<p>&#8230;<br />
public void testValidElement() {<br />
     selenium.returnElement(&#8220;//a&#8221;);<br />
}</p>
<p>public void testInvalidElement() {<br />
     selenium.returnElement(&#8220;invalid&#8221;);<br />
}<br />
&#8230;</p>
<p>When running the test, different exceptions are thrown:</p>
<p>1. In case of non-existing element:<br />
com.thoughtworks.selenium.SeleniumException: ERROR: Element invalid not found<br />
	at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)<br />
	at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)<br />
	at com.thoughtworks.selenium.DefaultSelenium.returnElement(DefaultSelenium.java:743)<br />
	at MyTest.testInvalidElement(MyTest.java)</p>
<p>2. In case of existing element:<br />
com.thoughtworks.selenium.SeleniumException: this.waitForCondition is not a function<br />
	at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)<br />
	at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)<br />
	at com.thoughtworks.selenium.DefaultSelenium.returnElement(DefaultSelenium.java:743)<br />
	at MyTest.testValidElement(MyTest.java)</p>
<p>The latter exception is also thrown when the doReturnElement simply returns a string.</p>
<p>Thank you very much in advance,<br />
Irina</p>
]]></content:encoded>
	</item>
</channel>
</rss>

