Closed JocelynLiu closed 7 years ago
Below usage cannot read the value in context scope. This element is input.
<step name="POSTAL_CODE" type="CLICK" page="LandingPage" />
<step name="POSTAL_CODE" type="SET" page="LandingPage">
<parameter type="CONTEXT" value="GET_POSTAL_CODE" />
</step>
`
<step name="POSTAL_CODE" type="SET" page="LandingPage">
<parameter type="CONTEXT" value="GET_POSTAL_CODE" />
</step>`
Can you send the object reposiotry entry for the elements referenced above along with a excerpt from the HTML page source?
It's a regular Input element. Nothing is special.
1) This is the corresponding Object Repository
`
<element name="SUBMIT_BUTTON" value="btn-submit" descriptor="ID" />
</page>`
2) This is key-word driven test steps, the defect can be seen in the 2nd last step because the CONTEXT variable was not initialized properly with keyword "GET" before. ---- btw, this is some dummy code to reproduce the defect. It doesn't make sense in real life.
`
<step name="POSTAL_CODE" type="EXISTS" page="LandingPage" />
<step name="SUBMIT_BUTTON" type="EXISTS" page="LandingPage" />
<step name="POSTAL_CODE" type="SET" page="LandingPage">
<parameter type="STATIC" value="M3A 2R6" />
</step>
<step name="POSTAL_CODE" type="EXECJS" page="LandingPage">
<parameter type="STATIC" value="return document.getElementById('postal-code').blur();"/>
</step>
<step name="WAIT_5_SEC" type="WAIT" page="LandingPage">
<parameter type="STATIC" value="5" />
</step>
<step name="POSTAL_CODE" page="LandingPage" type="GET" context="GET_POSTAL_CODE" />
<step name="POSTAL_CODE" type="CLICK" page="LandingPage" />
<step name="POSTAL_CODE" type="SET" page="LandingPage">
<parameter type="CONTEXT" value="GET_POSTAL_CODE" />
</step>
<step name="SUBMIT_BUTTON" type="CLICK" page="LandingPage" />
</process>`
3) This is the Input element in HTML
<input id="postal-code" name="postalCode" value="" type="text" class="text blocks form-control input-lg empty" data-watch="true" placeholder="Postal Code" aria-required="true" autocomplete="off">
Resolvled by adding proper break statements - fixed in 1.0.6
When trying to read the value from Input element, it returns null instead of the value attribute.
I fixed it locally, will commit it soon.