Unified Functional Testing Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Problem filling an input box that has onFocus="clearForm()"

Occasional Advisor

Problem filling an input box that has onFocus="clearForm()"

I'm using descriptive programming to fill a search field and submit it. The value comes out of a dataTable. Mostly what occurs when the script runs is the placeholder text 'Search' vanishes and the value I want to have in there does not get added. It remains blank.

 

I suspect the clearForm in the field's properties is intefering.

I tried putting a line before filling in the value with just .Click to see if that would prepare the field for my value, but no go.

 

Here is the input box:

 

<input type="text" id="searchText" name="searchText" value="Search" onkeypress="javascript&colon;submitEnter(event);" onFocus="clearForm('searchText');"/>

 

Here is what I have to add my value:

Browser("Browser").Page("Page").WebEdit("searchText").Set DataTable("prodName", dtLocalSheet)
Browser("Browser").Page("Page").WebEdit("searchText").Image("go").Click

 

Anyone know how to get around this?

 

2 REPLIES
Occasional Advisor

Re: Problem filling an input box that has onFocus="clearForm()"

the board stripped the colon between 'javascript' 'submitEnter...' when I posted the question :(
Highlighted
Occasional Advisor

Re: Problem filling an input box that has onFocus="clearForm()"

Got it, thanks!