Forum Discussion

lokithorshield's avatar
lokithorshield
Contributor
9 years ago

Namemapping using innerhtml

Hi There was a Testcomplete appointed trainer who came to our organization. There was some mention of HTML properties to be not used as reliable name mapping.

 

I am not sure what that was - if it was InnerHtml or OuterHtml. Can someone point out if we should not use them or if they are not reliable?.

 

Thanks,

Mahesh

5 Replies

  • I've used them before.

     

    Not for everything, just where it's been helpful. Never had any problem with either?

     

    I have a feeling it may be something to do with cross-browser compatibility if they do prove unreliable. (I only really use IE & Chrome)

    • lokithorshield's avatar
      lokithorshield
      Contributor

      Hi , Can someone help with this answer  .. Where exactly the reliability is?, Not a very urgent Q - but need to plan ahead of time.

       

      Mahesh

      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Hi,

        I don’t know what that person meant exactly. However, in my opinion, if HTML properties are unreliable, web developers created a web site in this way. Perhaps, the idea was that HTML elements contain dynamic IDs, etc. However, again, everything depends on your web site.

         

  • Hi,

     

    innerHTML and outerHTML when used gives problem while running scripts on different browsers as well as different browser versions.The script which might be running successfully for IE 10 can fail for IE11.

    Likewise if the script is running successfully for IE can fail for Firefox or Chrome as innerHTML can or cannot be same for different browsers.

     

    -Neha