Forum Discussion

rratchat's avatar
rratchat
New Contributor
11 months ago
Solved

Cannot get a dynamic ID by using GetPropertyValue.

I have tried to get a dynamic ID by using GetPropertyValue, but it is not working. Do you guys have any ideas? ... let dropdownListBoxObject = screenObject.FindElement("/html/body/div[2]/div/div")...
  • rraghvani's avatar
    11 months ago

    Here's an example,

     

    function w3schools()
    {
        // URL https://www.w3schools.com/html/tryit.asp?filename=tryhtml_id_css
        var page = NameMapping.Sys.browser.Page("https://www.w3schools.com/html/tryit.asp?filename=tryhtml_id_css").Panel("container").Panel("iframecontainer").Panel("iframe").Panel("iframewrapper").Frame("iframeResult");
        var item = page.TextNode("myHeader");
        Log.Message(item.getAttribute("id"));
    }

     

    Use getAttribute() method.

     

    I think GetPropertyValue() is returning this value,