Hi @VJR,
Thanks for the links to videos, I have already saw these and unfortunately I need more advanced tips than these.
The idea is, that page I would like to run automation on, is dynamic. The Item/button names are the same, but JS path and selectors are different each time if using menu buttons. I don't know how to solve this properly with PA UI in such environment. This was the reason I would like to use JavaScript instead, as by script I can locate the Item I need to click or fill with text quite simple, but then, PA is not running the script on the page.
The UI elements with static page is quite simple, like on the videos, but if needed complicated solution, there is lack of proper and advanced information how it works, how it reflects the path I can get from page by Inspect the element and how to use it on UI element.
Just as example, let's take an element from one local page, element is a simple button/link:
1. Element path in page I can get through Inspect:
1.1. Selector: #quick-site-section-navigation-inner > a:nth-child(5) > span
1.2. JS Path: document.querySelector("#quick-site-section-navigation-inner > a:nth-child(5) > span")
1.3. XPath: //*[@id="quick-site-section-navigation-inner"]/a[4]/span
1.4. XPath full: /html/body/header/div[2]/div[1]/div/div[1]/nav/a[4]/span
2. PA UI Selector if I click the element from PA UI menu:
2.1. UI Element: nav[Id="quick-site-section-navigation-inner"] > a[Class="nav-link text-pale-sky notranslate p-2 px-overwrite-4 "]:eq(3) > span
Yes, I can see some similarities and could guess what is what in simple situations, but if I need to write the UI Selector code in section 2 from info I can get from section 1, I can't! And this is just a simplest example.
==
And now regarding solution I have using now. this is kind of a workaround until I will found something more solid.
I have created flow with following logic - each time I open a page as a new page, by this making sure that elements are generated with same address/location. I don't use buttons, but opening new page each time it is necessary.
Finding the first element and after I'm building the flow with Send Keys from keyboard.
Sounds embarrassing, but at least it works so far 🙂