Forum Discussion

KellyWiegand's avatar
KellyWiegand
Occasional Contributor
2 years ago

How to fill all the text box in page?

Hi, Is there a way I can fill the entire page by script? We have some pages that are similar, but have little difference such as pageA has 2 more textbox than pageB. I don't know the specific diff...
  • rraghvani's avatar
    2 years ago

    Here's an example that highlights all the objects where ObjectType equals Textbox,

    function Fields()
    {
        // https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_test
        var page = NameMapping.Sys.Browser("chrome").Page("https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_test").Panel("container").Panel("iframecontainer");
        var fields = page.FindAll("ObjectType", "Textbox", 100);
        for (var i = 0; i < fields.length; i++) {
            Sys.HighlightObject(fields[i]);
        }
    }