« Return to Thread: Enconding problem - SeleneseTestCase - selenium.type - GWT

Re: Enconding problem - SeleneseTestCase - selenium.type - GWT

by Karl55 :: Rate this Message:

Reply to Author | View in Thread

Hi,


For me it works fine.
I'm using selenium 1.0 beta 2 .

As a trick, to avoid using  special characters, you could use :

 browser.type("//input[contains(@name,'Usu') and contains(@name,'rio')]", "someone");

or try to install selenium 1.0 beta 2


Regards


ea_br wrote:
Hello,

I'm using the Selenium 0.9.2 on my WindowsXP for a simple test.
Java, jdk-1.5.06

I have a user authentication  page which asks for a login/pass. I'm trying to automate my tests on this GWT page.
Everything is ok, I can put strings on password field and I can catch the "click" events (asserting for true or false).

I have only one big problem, the login field has an word with an accent, and Selenium is showing
a not-found message although it shows the same string when I invoke the getBodyText() method.

Here is the code piece.

The method getBodyText() shows:
Usußrio

The error message is:
testRegistrationUIElements(GAOTest)com.thoughtworks.selenium.SeleniumException: ERROR: Element //input[@name='Usußrio'] not found

I'm compiling the code and invoking it with ISO-8895-1 encoding.

------------------------

import junit.framework.TestCase;
import com.thoughtworks.selenium.*;
import java.lang.String;

public class GAOTest extends SeleneseTestCase {

    private Selenium browser;
    public void setUp() {
        browser = new DefaultSelenium("localhost", 4444, "*firefox",
                "http://200.xx.xx.xx:8080");
        browser.start();
    }

    public void testRegistrationUIElements() throws InterruptedException {
        ...
        browser.type("//input[@name='Usuário']", "someone");
        browser.fireEvent("//input[@name='Usuário']", "blur");

        browser.type("//input[@name='pass']", "somepass");
        browser.fireEvent("//input[@name='pass']", "blur");
    }
}

--------------------

Can you help me?

Thank you.

 « Return to Thread: Enconding problem - SeleneseTestCase - selenium.type - GWT