Explain script recorded over tested web pages

Why is the script recorded over the tested web pages not playback correctly?

E

Expert

Verified

Probably the script addresses web page elements through their index. TestComplete uses indexes when the element does not have the Id or Name attribute (when any of these attributes are given, TestComplete uses the attribute value to address that element). By using Id or Name is more reliable than using the indexes because the indexes can change from one test run to other. To work in the problem, use any of the approaches as given here:
• In the source code of the tested web page, identify the Name or Id attribute for all controls which you need to work along with from scripts. On doing this, you will be capable to address the controls using the given identifiers.
• Utilize the Page (…).NativeWebObject.Find method to search for the needed control by values of its properties and attributes (innerHTML, innerText, src and href).

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.