# Creating Pattern To access web GUI element

**URL:** <https://community.automationedge.com/t/creating-pattern-to-access-web-gui-element/3118>\
**Category:** Get Help & Discuss\
**Created:** [April 12, 2021, 7:23am UTC](https://community.automationedge.com/t/creating-pattern-to-access-web-gui-element/3118 "2021-04-12T07:23:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)\
**Post date:** [April 12, 2021, 7:23am UTC](https://community.automationedge.com/t/creating-pattern-to-access-web-gui-element/3118/1 "2021-04-12T07:23:07Z")

</div>

Hello sir/madam

This is shubham Prajapati I am facing the problem in storing the list of product name from searched result Flipkart.

**Problem** :

1. I searched “[Motorola mobile](https://www.flipkart.com/search?q=motorola%20mobile&otracker=search&otracker1=search&marketplace=FLIPKART&as-show=on&as=off)” in flipkart **search box** and list of motorola mobile displayed

2)Now I want to store all the name of product (24 product name listed out of Number of search result in first page). In this search result **117** product listed (See snapshot or Click on URL above.

As every product name has \*\*different X-path ,\*\*so creating problem to access individual element

1. I want to store all these 24 product name and click on **NEXT button** at bottom.

this to be continue till reaches last product name

In Ui-Path We can create **pattern of selection of element** and it automatically select element one by

 ![flipkart_productname_storing](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/ca4f6717c0ff2ca21bd1fed19dd7e573cc7dd278.png) one and were able to store all the product name list till the last product name.

**Is There Any way that we can do?**

---

<div class="post-metadata">

**Author:** ![fbaldin](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/fbaldin/32/99_2.png) [@fbaldin](https://community.automationedge.com/u/fbaldin)\
**Post date:** [April 13, 2021, 3:06pm UTC](https://community.automationedge.com/t/creating-pattern-to-access-web-gui-element/3118/2 "2021-04-13T15:06:43Z")

</div>

Yes, you need to manually create the Xpath as a Variable, where you would add +1 do that XPath and that would be the next product on the page. Until you’ll try to access an element that doesn’t exist, then you click on the next element, You’ll have to create a loop in the process.  
Here’s an image from the process and how it would look like:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/2101b62f036e2cf27fa83b3adfafc9a796a4759a.jpeg)

Here’s the Start Loop Configuration:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/1X/7cf83fc9d6a21166b06ece7cb74260fac02d8fa0.png)

At the exit loop you’ll change the value for the var LinhaExiste:  
_ **var** LinhaExiste = **false** ;_

Hope it helps

---

<div class="post-metadata">

**Author:** ![Imran\_Bhole](https://avatars.discourse-cdn.com/v4/letter/i/b9e5f3/32.png) [@Imran\_Bhole](https://community.automationedge.com/u/Imran_Bhole)\
**Post date:** [April 14, 2021, 7:03am UTC](https://community.automationedge.com/t/creating-pattern-to-access-web-gui-element/3118/3 "2021-04-14T07:03:11Z")

</div>

Hi Shubham,

1. first get number of div present on web page
2. then iterate loop till that number of div calculated from the 1. step.
3. use this Xpath inside the for loop //\*[@id=“container”]/div/div[3]/div[1]/div[2]/div[“replace i value here”]/div/div/div/a/div[2]/div[1]/div[1]
4. Once loop get finished click on next button till button is present
5. you will require one while and one for loop here
6. first while loop for click on next button and inside that you will need one for loop for iterate devices

---

<div class="post-metadata">

**Author:** ![Shubhamautomation](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/shubhamautomation/32/604_2.png) [@Shubhamautomation](https://community.automationedge.com/u/Shubhamautomation)\
**Post date:** [April 15, 2021, 5:21am UTC](https://community.automationedge.com/t/creating-pattern-to-access-web-gui-element/3118/4 "2021-04-15T05:21:21Z")

</div>

Ok I’ll Try
