Forum Discussion

jcamacho's avatar
jcamacho
New Contributor
10 years ago

looking for some help with Deja Click, - Selecting from drop down menu

 

"I'm trying to create a script/recording that will select the current month from a drop down menu.

 

I'm trying to use the code below as a Java script Variable

var currentDate = new Date()
var month = currentDate.getMonth()
document.getElementById('Policy_InceptionDate-m').selectedIndex = month;

but get the following error when i try to preview the results.

Variable preview:

Unable to populate script variable: <missing value>"

 

 

Here is an example of the website code;

<select id="Policy_InceptionDate-m" class="min" onblur="copyDate(this)" onchange="copyDate(this)" tabindex="231" name="Policy_InceptionDate-m" dcprevstyle="" style="outline: 2px solid #BEEBBA; outline-offset: 1px; background-color: #F9FEF9 !important;">

    <option value=""></option>
    <option value="01">

        January

    </option>
    <option value="02"></option>
    <option value="03"></option>
    <option value="04"></option>
    <option value="05"></option>
    <option value="06"></option>
    <option value="07"></option>
    <option value="08"></option>
    <option value="09"></option>
    <option value="10"></option>
    <option value="11"></option>
    <option value="12"></option>

 

  • sapnanatarajan's avatar
    sapnanatarajan
    SmartBear Alumni (Retired)

    What browser are you using to replay. Are using "Script Variable" or "Javascript Validation" feature ?

    • jcamacho's avatar
      jcamacho
      New Contributor

      I'm replaying through FireFox and using a script variable

      • sapnanatarajan's avatar
        sapnanatarajan
        SmartBear Alumni (Retired)

        There is an issue with evaluation Javascript in the recent version of FF. Can you please try the same with the Dejaclick Chrome extension and see if that resolves it.