Reputation: 1
Hi I am working with selenium using Java. I have an editable table in which I need to enter nearly 12-17 values continuously. what I was trying is:
Prdcode.sendkeys(keys.TAB,"1000",keys.TAB,keys.TAB,"2000",....etc);
Now the problem is that it's not entering all the values; If I send 1000, it enters only 10 and triggers tab.
I have even tried "\t"
but the problem is that it will append all the values instead of 'clear and enter'. Can some one help me on this?
Upvotes: 0
Views: 4182
Reputation: 848
First of all it is not
sendkeys()
. Please usesendKeys()
.
Solution:
Use multiple sendkeys()
as given below.
Prdcode.sendKeys(keys.TAB);
Prdcode.sendKeys("1000");
Prdcode.sendKeys(keys.TAB);
Prdcode.sendKeys("2000");
Prdcode.sendKeys(.......);
Possible problems and solution :
Prdcode
is only one element and script is overwriting existing data. Here you can change next element as per given HTML. Refer this. Example :
ele1.sendKeys("1000");
ele2.sendKeys("2000");
ele3.sendKeys(.......);
Note : No need to use Prdcode.sendKeys(keys.TAB);
Prdcode
have some data entry limit. (Please check manually). If yes then script can not add string more than limit (Valid scenario).
If scenario 1 is entering data randomly, then use Thread.sleep(1000);
between sendKeys()
.
See :
ele1.sendKeys("1000");
Thread.sleep(1000);
ele2.sendKeys("2000");
Thread.sleep(1000);
ele3.sendKeys(.......);
Thread.sleep(1000);
Upvotes: 1