Question: [edit for godman] I am working on a web based application, written in PHP. I am using Selenium RC to run tests on the webpages produced by this application, through a browser.

I just upgraded to Firefox 14, so I had to upgrade to Selenium RC 2.25.0.

Now I'm seeing this error when running a test with htmlSuite:

> 
> Command execution failure. Please search the user group at
>  <https://groups.google.com/forum/#!forum/selenium-users> for error
>  details from the log window. The error message is: t.replace is not a
>  function
> 
> 
> 

The command executed is: 

```
clickAndWait    //a[text()='! selenium test customer']

```

As you can see, it's not doing anything too tricky - just clicking a link. The test runs fine in the IDE, it's just when run via RC that it's a problem.

Searching in the groups revealed only really old threads dating back to version 1 of selenium.
Any ideas anyone?

[edit] I've been running the test that has these problems several times a day for the last week - and it doesn't seem to fail like this every time. This looks like it's a random problem. Has anyone seen this happen before?

[edit after the bounty got me no answers] Another example of it failing is with:

```
clickAndWait   css=a.edit_company

```

This same call works fine earlier in the same test, on the same page.

[edit] Now I'm seeing the same error with a completely separate command:

```
type    id=Address1     Address1

```

Does anyone have any suggestions about this? Any way I can even debug what's going on (I don't see this in the IDE at all)

Answer: 
I am not terribly familiar with clickAndWait. I personally prefer clicking and then doing my own custom waiting.

Try just clicking and add a Thread.Sleep(5000), or something similar, and see if the error is a result of the click or the wait part.

If it is the wait part, then I have a different suggestion than if it is the click part.
Usually, this kind of error would occur if you are dealing with something that is not a string. Could you just make sure that you are dealing with strings only?

2 possibilities where it is arising from:-

1. When text() is executed -> it might be dealing with a non-string
2. a[expression] -> the expression(text() = '! selenium test customer') when evaluated to False/True might be the problem because if a is a Map/array, the corresponding key should be a string and not a bool, probably.
3. text()='! selenium test customer' -->> is it an assignment operation? if yes, make sure that text() returns a lvalue or a mutable object (based on the language you are using selenium rc with)