<?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>Mon, 21 Jun 2010 03:42:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<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>
	<item>
		<title>By: satyadev</title>
		<link>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/comment-page-1/#comment-8656</link>
		<dc:creator>satyadev</dc:creator>
		<pubDate>Fri, 07 Aug 2009 05:21:17 +0000</pubDate>
		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/#comment-8656</guid>
		<description>Does UI-element have support with selenium grid ? I am not able to execute with GRID . however I was able to use UI-element with IDE with out any issues?

I used &#039;selenium.setExtensionJs()&#039; method before starting browser even though, I got following error message
 [java] 22:31:53.531 INFO - Got result: ERROR: Element ui=allPages::Productsolutions() not found on session 4c57c1826fb44e74b729fbe60afd2f45.

Any thing I missed ? 

thanks,
Satyadev</description>
		<content:encoded><![CDATA[<p>Does UI-element have support with selenium grid ? I am not able to execute with GRID . however I was able to use UI-element with IDE with out any issues?</p>
<p>I used &#8216;selenium.setExtensionJs()&#8217; method before starting browser even though, I got following error message<br />
 [java] 22:31:53.531 INFO &#8211; Got result: ERROR: Element ui=allPages::Productsolutions() not found on session 4c57c1826fb44e74b729fbe60afd2f45.</p>
<p>Any thing I missed ? </p>
<p>thanks,<br />
Satyadev</p>
]]></content:encoded>
	</item>
</channel>
</rss>
