Ui-Path: How to handle dynamic web elements












1














I am new to UIPath tool. please accept my apologizes if it's a poor question.



I need to clicksendKeys a web element, which is totally a dynamic element.
ID will keep change for everytime when loading the page.



Login 1: <span id="x58Sn0-cnt" class="z-tab-text" uipath_custom_id="8">Update</span>

Login 2: <span id="nT9Tn0-cnt" class="z-tab-text">Update</span>

Note:
Also we can't relay on class "z-tab-text" because so many other elements are sharing the same class.


thanks in advance. :)










share|improve this question


















  • 1




    What about the -cnt part in both IDs?
    – Morris Miao
    Jul 5 '17 at 4:35










  • @MorrisMiao The IDs looks like something that gets autogenerated, not saying they are - just looks like it.
    – Nicolai Krüger
    Jul 5 '17 at 7:47










  • @Rojer Feds, Could you provide a link or more HTML and maybe also an image of the page. UiPath have som pretty nice image capabilities?
    – Nicolai Krüger
    Jul 5 '17 at 7:48






  • 1




    @NicolaiKrüger if you can see all of them in a form ending with "-cnt" then you may probably use wildcard characters in your selectors e.g. *-cnt, and you should be able to get them.
    – Morris Miao
    Jul 5 '17 at 7:50












  • @NicolaiKrüger another way is to use OCR-type activities, find the positions of "Login", and to use relative position to find the text box where you want to put your texts in.
    – Morris Miao
    Jul 5 '17 at 7:54
















1














I am new to UIPath tool. please accept my apologizes if it's a poor question.



I need to clicksendKeys a web element, which is totally a dynamic element.
ID will keep change for everytime when loading the page.



Login 1: <span id="x58Sn0-cnt" class="z-tab-text" uipath_custom_id="8">Update</span>

Login 2: <span id="nT9Tn0-cnt" class="z-tab-text">Update</span>

Note:
Also we can't relay on class "z-tab-text" because so many other elements are sharing the same class.


thanks in advance. :)










share|improve this question


















  • 1




    What about the -cnt part in both IDs?
    – Morris Miao
    Jul 5 '17 at 4:35










  • @MorrisMiao The IDs looks like something that gets autogenerated, not saying they are - just looks like it.
    – Nicolai Krüger
    Jul 5 '17 at 7:47










  • @Rojer Feds, Could you provide a link or more HTML and maybe also an image of the page. UiPath have som pretty nice image capabilities?
    – Nicolai Krüger
    Jul 5 '17 at 7:48






  • 1




    @NicolaiKrüger if you can see all of them in a form ending with "-cnt" then you may probably use wildcard characters in your selectors e.g. *-cnt, and you should be able to get them.
    – Morris Miao
    Jul 5 '17 at 7:50












  • @NicolaiKrüger another way is to use OCR-type activities, find the positions of "Login", and to use relative position to find the text box where you want to put your texts in.
    – Morris Miao
    Jul 5 '17 at 7:54














1












1








1


1





I am new to UIPath tool. please accept my apologizes if it's a poor question.



I need to clicksendKeys a web element, which is totally a dynamic element.
ID will keep change for everytime when loading the page.



Login 1: <span id="x58Sn0-cnt" class="z-tab-text" uipath_custom_id="8">Update</span>

Login 2: <span id="nT9Tn0-cnt" class="z-tab-text">Update</span>

Note:
Also we can't relay on class "z-tab-text" because so many other elements are sharing the same class.


thanks in advance. :)










share|improve this question













I am new to UIPath tool. please accept my apologizes if it's a poor question.



I need to clicksendKeys a web element, which is totally a dynamic element.
ID will keep change for everytime when loading the page.



Login 1: <span id="x58Sn0-cnt" class="z-tab-text" uipath_custom_id="8">Update</span>

Login 2: <span id="nT9Tn0-cnt" class="z-tab-text">Update</span>

Note:
Also we can't relay on class "z-tab-text" because so many other elements are sharing the same class.


thanks in advance. :)







uipath






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 4 '17 at 15:37







user6071082















  • 1




    What about the -cnt part in both IDs?
    – Morris Miao
    Jul 5 '17 at 4:35










  • @MorrisMiao The IDs looks like something that gets autogenerated, not saying they are - just looks like it.
    – Nicolai Krüger
    Jul 5 '17 at 7:47










  • @Rojer Feds, Could you provide a link or more HTML and maybe also an image of the page. UiPath have som pretty nice image capabilities?
    – Nicolai Krüger
    Jul 5 '17 at 7:48






  • 1




    @NicolaiKrüger if you can see all of them in a form ending with "-cnt" then you may probably use wildcard characters in your selectors e.g. *-cnt, and you should be able to get them.
    – Morris Miao
    Jul 5 '17 at 7:50












  • @NicolaiKrüger another way is to use OCR-type activities, find the positions of "Login", and to use relative position to find the text box where you want to put your texts in.
    – Morris Miao
    Jul 5 '17 at 7:54














  • 1




    What about the -cnt part in both IDs?
    – Morris Miao
    Jul 5 '17 at 4:35










  • @MorrisMiao The IDs looks like something that gets autogenerated, not saying they are - just looks like it.
    – Nicolai Krüger
    Jul 5 '17 at 7:47










  • @Rojer Feds, Could you provide a link or more HTML and maybe also an image of the page. UiPath have som pretty nice image capabilities?
    – Nicolai Krüger
    Jul 5 '17 at 7:48






  • 1




    @NicolaiKrüger if you can see all of them in a form ending with "-cnt" then you may probably use wildcard characters in your selectors e.g. *-cnt, and you should be able to get them.
    – Morris Miao
    Jul 5 '17 at 7:50












  • @NicolaiKrüger another way is to use OCR-type activities, find the positions of "Login", and to use relative position to find the text box where you want to put your texts in.
    – Morris Miao
    Jul 5 '17 at 7:54








1




1




What about the -cnt part in both IDs?
– Morris Miao
Jul 5 '17 at 4:35




What about the -cnt part in both IDs?
– Morris Miao
Jul 5 '17 at 4:35












@MorrisMiao The IDs looks like something that gets autogenerated, not saying they are - just looks like it.
– Nicolai Krüger
Jul 5 '17 at 7:47




@MorrisMiao The IDs looks like something that gets autogenerated, not saying they are - just looks like it.
– Nicolai Krüger
Jul 5 '17 at 7:47












@Rojer Feds, Could you provide a link or more HTML and maybe also an image of the page. UiPath have som pretty nice image capabilities?
– Nicolai Krüger
Jul 5 '17 at 7:48




@Rojer Feds, Could you provide a link or more HTML and maybe also an image of the page. UiPath have som pretty nice image capabilities?
– Nicolai Krüger
Jul 5 '17 at 7:48




1




1




@NicolaiKrüger if you can see all of them in a form ending with "-cnt" then you may probably use wildcard characters in your selectors e.g. *-cnt, and you should be able to get them.
– Morris Miao
Jul 5 '17 at 7:50






@NicolaiKrüger if you can see all of them in a form ending with "-cnt" then you may probably use wildcard characters in your selectors e.g. *-cnt, and you should be able to get them.
– Morris Miao
Jul 5 '17 at 7:50














@NicolaiKrüger another way is to use OCR-type activities, find the positions of "Login", and to use relative position to find the text box where you want to put your texts in.
– Morris Miao
Jul 5 '17 at 7:54




@NicolaiKrüger another way is to use OCR-type activities, find the positions of "Login", and to use relative position to find the text box where you want to put your texts in.
– Morris Miao
Jul 5 '17 at 7:54












3 Answers
3






active

oldest

votes


















0














I've managed this usecase by using idx






I know it's not recommended for failing cases i'll go with image. Now it's fail free.






share|improve this answer





























    0














    You may refer to the parent elements in order to get the right selector, for this you should be using the css-selector property instead of considering the id html attribute. For instance, let's suppose the dynamic element is always the first child of a div, then you could use:



    <webctrl css-selector='div span:first-child'/>


    The syntax for the css-selector property is the same as used in element selectors in CSS sheets for HTML files.



    Just to comment, you can also find more tips and discussion in UiPathForum, which is full of knowledge and discussion about specific implementations on this tool.






    share|improve this answer































      0














      You will likely need to use a combination of the wildcard operators(*, ?) and maybe the aaname(text) attribute by the looks of it. maybe something like this:



      <webctrl id="*-cnt" aaname="Update" />


      Wildcards: If there are parts of your ID that will always be the same, then at least the wildcard in the selector will help somewhat in the selection process.




      Asterisk (*) – replaces zero or more characters



      Question mark (?) – replaces a single character




      UIPath Selectors with Wildcards Documentation



      I would recommend going through the Foundation Training for UIPath as it seems to help quite a bit and it is free. Honestly, though, it is my opinion that RPA is not perfect for every web application use, especially when there is highly dynamic HTML and unreliable selectors. Angular & Knockout apps are great examples. Many time Angular uses javascript objects instead of specific IDs and data-attributes, which UIPath does not have access to, so this creates an environment where you have to get creative with selecting selectors that will work. It also means that those selectors will break with any little code changes.






      share|improve this answer





















        Your Answer






        StackExchange.ifUsing("editor", function () {
        StackExchange.using("externalEditor", function () {
        StackExchange.using("snippets", function () {
        StackExchange.snippets.init();
        });
        });
        }, "code-snippets");

        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "1"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44909853%2fui-path-how-to-handle-dynamic-web-elements%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown
























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0














        I've managed this usecase by using idx






        I know it's not recommended for failing cases i'll go with image. Now it's fail free.






        share|improve this answer


























          0














          I've managed this usecase by using idx






          I know it's not recommended for failing cases i'll go with image. Now it's fail free.






          share|improve this answer
























            0












            0








            0






            I've managed this usecase by using idx






            I know it's not recommended for failing cases i'll go with image. Now it's fail free.






            share|improve this answer












            I've managed this usecase by using idx






            I know it's not recommended for failing cases i'll go with image. Now it's fail free.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 6 '17 at 13:54







            user6071082
































                0














                You may refer to the parent elements in order to get the right selector, for this you should be using the css-selector property instead of considering the id html attribute. For instance, let's suppose the dynamic element is always the first child of a div, then you could use:



                <webctrl css-selector='div span:first-child'/>


                The syntax for the css-selector property is the same as used in element selectors in CSS sheets for HTML files.



                Just to comment, you can also find more tips and discussion in UiPathForum, which is full of knowledge and discussion about specific implementations on this tool.






                share|improve this answer




























                  0














                  You may refer to the parent elements in order to get the right selector, for this you should be using the css-selector property instead of considering the id html attribute. For instance, let's suppose the dynamic element is always the first child of a div, then you could use:



                  <webctrl css-selector='div span:first-child'/>


                  The syntax for the css-selector property is the same as used in element selectors in CSS sheets for HTML files.



                  Just to comment, you can also find more tips and discussion in UiPathForum, which is full of knowledge and discussion about specific implementations on this tool.






                  share|improve this answer


























                    0












                    0








                    0






                    You may refer to the parent elements in order to get the right selector, for this you should be using the css-selector property instead of considering the id html attribute. For instance, let's suppose the dynamic element is always the first child of a div, then you could use:



                    <webctrl css-selector='div span:first-child'/>


                    The syntax for the css-selector property is the same as used in element selectors in CSS sheets for HTML files.



                    Just to comment, you can also find more tips and discussion in UiPathForum, which is full of knowledge and discussion about specific implementations on this tool.






                    share|improve this answer














                    You may refer to the parent elements in order to get the right selector, for this you should be using the css-selector property instead of considering the id html attribute. For instance, let's suppose the dynamic element is always the first child of a div, then you could use:



                    <webctrl css-selector='div span:first-child'/>


                    The syntax for the css-selector property is the same as used in element selectors in CSS sheets for HTML files.



                    Just to comment, you can also find more tips and discussion in UiPathForum, which is full of knowledge and discussion about specific implementations on this tool.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jul 13 '17 at 14:10

























                    answered Jul 13 '17 at 13:47









                    brunoazev

                    464




                    464























                        0














                        You will likely need to use a combination of the wildcard operators(*, ?) and maybe the aaname(text) attribute by the looks of it. maybe something like this:



                        <webctrl id="*-cnt" aaname="Update" />


                        Wildcards: If there are parts of your ID that will always be the same, then at least the wildcard in the selector will help somewhat in the selection process.




                        Asterisk (*) – replaces zero or more characters



                        Question mark (?) – replaces a single character




                        UIPath Selectors with Wildcards Documentation



                        I would recommend going through the Foundation Training for UIPath as it seems to help quite a bit and it is free. Honestly, though, it is my opinion that RPA is not perfect for every web application use, especially when there is highly dynamic HTML and unreliable selectors. Angular & Knockout apps are great examples. Many time Angular uses javascript objects instead of specific IDs and data-attributes, which UIPath does not have access to, so this creates an environment where you have to get creative with selecting selectors that will work. It also means that those selectors will break with any little code changes.






                        share|improve this answer


























                          0














                          You will likely need to use a combination of the wildcard operators(*, ?) and maybe the aaname(text) attribute by the looks of it. maybe something like this:



                          <webctrl id="*-cnt" aaname="Update" />


                          Wildcards: If there are parts of your ID that will always be the same, then at least the wildcard in the selector will help somewhat in the selection process.




                          Asterisk (*) – replaces zero or more characters



                          Question mark (?) – replaces a single character




                          UIPath Selectors with Wildcards Documentation



                          I would recommend going through the Foundation Training for UIPath as it seems to help quite a bit and it is free. Honestly, though, it is my opinion that RPA is not perfect for every web application use, especially when there is highly dynamic HTML and unreliable selectors. Angular & Knockout apps are great examples. Many time Angular uses javascript objects instead of specific IDs and data-attributes, which UIPath does not have access to, so this creates an environment where you have to get creative with selecting selectors that will work. It also means that those selectors will break with any little code changes.






                          share|improve this answer
























                            0












                            0








                            0






                            You will likely need to use a combination of the wildcard operators(*, ?) and maybe the aaname(text) attribute by the looks of it. maybe something like this:



                            <webctrl id="*-cnt" aaname="Update" />


                            Wildcards: If there are parts of your ID that will always be the same, then at least the wildcard in the selector will help somewhat in the selection process.




                            Asterisk (*) – replaces zero or more characters



                            Question mark (?) – replaces a single character




                            UIPath Selectors with Wildcards Documentation



                            I would recommend going through the Foundation Training for UIPath as it seems to help quite a bit and it is free. Honestly, though, it is my opinion that RPA is not perfect for every web application use, especially when there is highly dynamic HTML and unreliable selectors. Angular & Knockout apps are great examples. Many time Angular uses javascript objects instead of specific IDs and data-attributes, which UIPath does not have access to, so this creates an environment where you have to get creative with selecting selectors that will work. It also means that those selectors will break with any little code changes.






                            share|improve this answer












                            You will likely need to use a combination of the wildcard operators(*, ?) and maybe the aaname(text) attribute by the looks of it. maybe something like this:



                            <webctrl id="*-cnt" aaname="Update" />


                            Wildcards: If there are parts of your ID that will always be the same, then at least the wildcard in the selector will help somewhat in the selection process.




                            Asterisk (*) – replaces zero or more characters



                            Question mark (?) – replaces a single character




                            UIPath Selectors with Wildcards Documentation



                            I would recommend going through the Foundation Training for UIPath as it seems to help quite a bit and it is free. Honestly, though, it is my opinion that RPA is not perfect for every web application use, especially when there is highly dynamic HTML and unreliable selectors. Angular & Knockout apps are great examples. Many time Angular uses javascript objects instead of specific IDs and data-attributes, which UIPath does not have access to, so this creates an environment where you have to get creative with selecting selectors that will work. It also means that those selectors will break with any little code changes.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 20 at 15:28









                            MUlferts

                            6391819




                            6391819






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44909853%2fui-path-how-to-handle-dynamic-web-elements%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Create new schema in PostgreSQL using DBeaver

                                Deepest pit of an array with Javascript: test on Codility

                                Fotorealismo