|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Enconding problem - SeleneseTestCase - selenium.type - GWTHello,
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. |
|
|
Re: Enconding problem - SeleneseTestCase - selenium.type - GWTHi,
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
|
|
|
Re: Enconding problem - SeleneseTestCase - selenium.type - GWTHi,
I changed to Selenium 1.0 beta 2 and also to Java6. Your tip worked fine! But I also could solve my problem in the following way: browser.type("//input[@name='usuario']", "someone"); browser.fireEvent("//input[@name='usuario']", "blur"); May be I have not read carefully the documentation. I changed the "U" to "u" and removed the accent on my test class. The page continue the same, with accent as the getBodyText() still show me the String "Usußrio". Thank you!!
|
| Free embeddable forum powered by Nabble | Forum Help |