Domanda

I am writing unit test cases for my login application. and I am new in writing test cases. One of those test cases is I shuold pass username,password to EditText fields and on click of login button it will validate(assertion). For passing Username/Password I'm using sendKeys(..) api. I am able to send Lowecase/Uppercase/SpecialCharacters in any device which is below 4.0 version.
But the problem is on/above 4.0 version, I'm not able to send Uppercaseletters.

Here is the sample of my code:

sendKeys(KeyEvent.KEYCODE_SHIFT_LEFT,KeyEvent.KEYCODE_S, KeyEvent.KEYCODE_A, KeyEvent.KEYCODE_N,................

I have tried CAPSLOCK,SHIFT_RIGHT,ALT_RIGHT etc.. nothing is making it Uppercase in 4.0 versions. I have tried updating the SDK also for new updates. still no use. Not able to figure out what is the problem.

Please help.

Thanks in advance. Siri.

È stato utile?

Soluzione

This is an interesting question, but I think someone else has asked this before. The answer was this: https://stackoverflow.com/a/13466090/81520 and I am very happy to have found it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top