WebPagetest Forums
Not able to setvalue for the text field which has multiple layer(i.e. HTML5 page) - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: General Discussion (/forumdisplay.php?fid=25)
+--- Thread: Not able to setvalue for the text field which has multiple layer(i.e. HTML5 page) (/showthread.php?tid=13200)



Not able to setvalue for the text field which has multiple layer(i.e. HTML5 page) - adula.rajkumar@gmail.com - 08-27-2014 05:26 AM

Hi,

I am not able to setvalue for the text field which has multiple layer(i.e. HTML5 page) following are the attribute set for that text filed


below is the text field tag :
<input id="register-email" type="text" value="Email Address" name="EmailAddress" placeholder="Email Address" autocomplete="off" >

tried below
setValue name=EmailAddress xxx@x.com
setValue id=register-email xxx@x.com
setValue placeholder=Email Address xxx@x.com

could you please suggest how to setValue ?

Thanks
Raj


RE: Not able to setvalue for the text field which has multiple layer(i.e. HTML5 page) - andydavies - 08-27-2014 06:29 PM

Try execAndWait document.getElementById("register-email").value="xxx@x.com"; or some similar variation


RE: Not able to setvalue for the text field which has multiple layer(i.e. HTML5 page) - adula.rajkumar@gmail.com - 08-30-2014 03:06 AM

Thank you Andydavies its working

got one more issue

Not able to click the button which has placed on multiple layers(same page which was mentioned above), below are the attributes

<a class="button-submit" href="jsubmitAction()">Submit</a>

can anyone help me out to click this button ?

when used clickAndWait className=button-submit its not performing click operation
When used submitForm , form submitted with "null" values

Thanks in Advance
Rajkumar


RE: Not able to setvalue for the text field which has multiple layer(i.e. HTML5 page) - andydavies - 08-30-2014 08:15 PM

You can do a similar thing for that too e.g.

execAndWait document.getElementsByClassName("button-submit")[0].click();

obviously you'll need to adjust the index if there's more than one element with that class

I tend to write WPT scripts by testing the DOM code from a browser's dev tools console and then use execAndWait in WPT