- gkpandiActive particpant
- Posts : 14
Join date : 2013-05-23
How to remove existing values from the input fields?
Wed Jun 05, 2013 4:11 pm
Hi,
I'm trying to automate my page which contains certain input fields like textbox, drop down, button etc.
I have defined three methods for the following functionalities:
1. Open application
2. Get data from excel
3. Save data
4. Clear input fields after saved
Its working fine for the first iteration. Next time, the input field information are not cleared even I have used the script as below.
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.findElement(By.id("j_idt51:serviceLocationID")).clear();
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.findElement(By.id("j_idt51:AssigningAuthoritySystemVendorCode")).clear();
Note: Its appending new cell information with the existing information in the input fields.
Please help me to solve this problem.
Thanks
I'm trying to automate my page which contains certain input fields like textbox, drop down, button etc.
I have defined three methods for the following functionalities:
1. Open application
2. Get data from excel
3. Save data
4. Clear input fields after saved
Its working fine for the first iteration. Next time, the input field information are not cleared even I have used the script as below.
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.findElement(By.id("j_idt51:serviceLocationID")).clear();
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.findElement(By.id("j_idt51:AssigningAuthoritySystemVendorCode")).clear();
Note: Its appending new cell information with the existing information in the input fields.
Please help me to solve this problem.
Thanks
- mail2prassadAmateur
- Posts : 41
Join date : 2013-06-05
Re: How to remove existing values from the input fields?
Wed Jun 05, 2013 10:12 pm
Is the page being submitted when you save the data or is it an ajax call.
If the page is being submitted, then the elements driver reference to the elements will no longer be the same.
try to print or debug the values
driver.findElement(By.id("j_idt51:serviceLocationID"))
driver.findElement(By.id("j_idt51:AssigningAuthoritySystemVendorCode"))
check whether they are null, also please post the error stack.
If the page is being submitted, then the elements driver reference to the elements will no longer be the same.
try to print or debug the values
driver.findElement(By.id("j_idt51:serviceLocationID"))
driver.findElement(By.id("j_idt51:AssigningAuthoritySystemVendorCode"))
check whether they are null, also please post the error stack.
Permissions in this forum:
You cannot reply to topics in this forum