I have scoured the forums and the web to see if I can find a solution to this but to no avail, so I am coming to you guys and gals for help!
We have dynamic fields in our web application form which require keystroke actions to trigger the javascript on the input field to do a postback. I want to avoid using keystroke actions if I can so want to know if I can trigger the script using code.
The code for the postback contained in the page is:
Code: Select all
javascript:setTimeout('__doPostBack(\'ctl00$MainContent$ucResidential1$ucAddress$txttimeatadressmonths\',\'\')', 0)
Our developer tried this:
Code: Select all
public void TriggerPageLoad()
{
repo.OriginationSystem.Self.ExecuteScript("setTimeout(__doPostBack('ctl00$MainContent$ucResidential1$ucAddress$txttimeatadressmonths',''), 0)");
}
Code: Select all
public void TriggerPageLoad()
{
WebDocument webDocument = @"/dom[@domain=$varUATDomain]";
webDocument.ExecuteScript("setTimeout(__doPostBack('ctl00$MainContent$ucResidential1$ucAddress$txttimeatadressmonths',''), 0)");
}
Running Windows 8 and using Ranorex v6.0.0
Thanks in advance!
J