Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

» Selenium IDE Verify different Maps (Hybridview, Mapview etc.)
Fri Nov 25, 2016 9:56 pm by DJ87

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to remove existing values from the input fields?

View previous topic View next topic Go down

How to remove existing values from the input fields?

Post by gkpandi on 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

gkpandi
Active particpant
Active particpant

Posts : 14
Join date : 2013-05-23

Back to top Go down

Re: How to remove existing values from the input fields?

Post by mail2prassad on 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.

mail2prassad
Amateur
Amateur

Posts : 41
Join date : 2013-06-05

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum