3 Replies Latest reply: Sep 13, 2013 3:39 PM by 1004952 RSS

    How to identify the content of a confirmation dialog with OpenScript

    1004952

      Does anyone know how to get the content or objects inside a confirmation dialog (ADFDialog)?

       

      Basically we have confirmation dialog, and I would like to identify the text inside the dialog or any of the buttons that appears there, but we are not able using the record option, neither testing the objects since we only get the Title of the dialog (which in this case is not useful for us).

        • 1. Re: How to identify the content of a confirmation dialog with OpenScript
          user13153726

          When you inspect the object from OATS what ADF component is it (ADFInputText or ADFoutputtext)?

          • 2. Re: How to identify the content of a confirmation dialog with OpenScript
            Deepu Muraleedharan

            Try using getAttribue("")

             

            ie

             

            adf.dialog("").getAttribute("text");

            Cheers

            • 3. Re: How to identify the content of a confirmation dialog with OpenScript
              1004952

              Unfortunately there are very few attributes we can get from the ADFDialog component, only id, title and absoluteLocator are identifiable. And what I need exactly is either the text that is displayed or the Text of one of the Buttons that appears. I was able to get the button but recording the object form a new project "Web script" instead of an ADF script, that way the full path of the button is recorded and from there I can actually make sure that the button exists and then click it, so the text I was trying to get is due to the message being different between two dialogs, but also the buttons have different text so that one helped a lot, I could've got the text with an web.element("path").getAttribute("Text") but as I mention, I was able to get it using the web.button("path").exists() and then click().


              I was able also to get from the ADFDialog properties, but it requires going through the internals of the object. Something similar like this (where dialog is an instance of an ADFDialog object:


              List<DOMElement> elements = dialog.getChildrenDOMElements("button");

                  for (DOMElement element : elements) {

                      System.out.println("Tag = " + element.getTag() + ", Text = " + element.getAttribute("Text"));

                      if (element.getAttribute("Text").equals("Yes")) {

                          System.out.println("Button 'Yes' found");

                      }

                  }

               

              I strongly recommend to try to record by using a web script, that is way much easier and better way to do it, I was simple not aware of that and I did more complicated stuff and i was only trying to record from the ADF script project.