Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
gkpandi
Active particpant
Active particpant
Posts : 14
Join date : 2013-05-23

How to remove existing values from the input fields? Empty 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
avatar
mail2prassad
Amateur
Amateur
Posts : 41
Join date : 2013-06-05

How to remove existing values from the input fields? Empty 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.
Back to top
Permissions in this forum:
You cannot reply to topics in this forum