- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
09-27-2023 06:04 PM
Hi TC,
Long time lurker, first time poster. I am trying to create a web connector to Cisco DNAC however the login page changes each time someone connects. I have tried the plugin generator which picks up the ID field and because that changes on each login does not work. I have tried various forms of syntax to no avail. I have successfully built dozens of Web Connectors, however this one is a struggle.
Screenshot below: Sample of the HTML used for Cisco DNAC.
The ID Fields (RED BOX) Changes each time the page is refreshed to random chars. So using the ID is not viable. Looking to use the autocomplete="username" in green but I cannot seem to get any syntax working, nor can I find any detailed documentation to help work with the HTML code.
Hoping someone here can help my formulate the "WebFormFields" parameters to get this going or point me in the direction of some more detailed documentation.
Thanks in advanced.
Chris.
09-27-2023 09:14 PM
hi @Chris Noye ,
You're able to use class, text, XPath ,CSS ,.. follow this link : https://docs.cyberark.com/PAS/12.2/en/Content/PASIMP/psm_WebApplication.htm
09-27-2023 09:23 PM
Thanks Trung, Indeed I have read that page many many times over. It is lacking a bit in detail; the examples are basic and appears to be missing items. Some of the other pages I've done using the generator app have syntax that is no described in the document.
Any clues as to how you would tackle the screenshot above? even just for the username field and I should be able to work it out from there. I'm trying things constantly but to no avail thus far.
Kind Regards,
Chris.
09-27-2023 09:35 PM
Hi @Chris Noye ,
Let me show you how to use Xpath :
For XPath or full XPath, when using brackets [ ], include a caret (^) before each bracket like the image above
09-27-2023 11:04 PM
Thanks Trung, Indeed that is how i have been trying to do it. I am not getting any "parsing" errors, just the fields are never found, I thinkIi am missing the tag or text type or tag specific syntax within the XPATH.
Tried This (Full XPATH Username exported using the same method you described) (remember I can't use the ID tag because it changes every time the page is refreshed. I have to do something with autocomplete="username" or something else "text" in that tag list.
I added the ^ in the webformfields as below. No parsing error
/html/body/div^[1^]/div/div/div^[1^]/form/dnx-textfield^[1^]/div/div/div/div/input
[HTMLPageController :: FindElement -> Timeout error. Element '/html/body/div[1]/div/div/div[1]/form/dnx-textfield[1]/div/div/div/div/input' was not found in new page. ]
Tried this *//[contains(text(),'username']/div/div/div/div/input'
[HTMLPageController :: FindElement -> Timeout error. Element '*//[contains(text(),'username']/div/div/div/div/input' was not found in new page. ]
and tried other variants.
Tried this *//[@autocomplete="username"']/div/div/div/div/input'
and a few other variations but no luck. I've setup dozens of other connectors no problems but because the ID changes with this I can't seem to pick-up any of the fields...
Any ideas would be greatly appreciated.
Kind Regards,
Chris.
09-28-2023 12:07 AM
This is the full syntax I've tried.
/html/body/div^[1^]/div/div/div^[1^]/form/dnx-textfield^[1^]/div/div/div/div/input > {Username}
/html/body/div^[1^]/div/div/div^[1^]/form/dnx-textfield^[2^]/div/div/div/div^[1^]/input > {Password}
/html/body/div^[1^]/div/div/div^[1^]/form/dnx-button/button > (Button)The below is what i get from the clientdispatcher log.
PSMDU019I Dispatcher trace message: [HTMLPageController :: FindElement -> Waiting until element '/html/body/div[1]/div/div/div[1]/form/dnx-textfield[1]/div/div/div/div/input' is found in page. Timeout: '30'.]
PSMDU018E Dispatcher error: [ConnectionComponentController :: PopUpErrorMessageBox -> Title="Error Occurred" Message="Timeout error. Failed to find element '/html/body/div[1]/div/div/div[1]/form/dnx-textfield[1]/div/div/div/div/input' in page. Refer to the log for more information." Timeout=30 Subtitle="Login failed"]
I also tried appending (searchby=xpath) to each line of WebFormsFields to no avail.
[AttributeTypeBase :: Find -> Element '/html/body/div[1]/div/div/div[1]/form/dnx-textfield[1]/div/div/div/div/input' was not found using type 'XPATH'.]
I found a document that talks about the below methods/functions, some of which i thought might be useful, I've been trying to find information on how they work / syntax involved.
(From personal blog WebSite Creating CyberArk PSM Web Plugins | by Joe Agler | Medium)
Some additional examples for harder PSM Web or PSM Web CPM items:
//a[contains(text(),'Save')]>(Button)(searchby=xpath)
//a[contains(text(),'admin')]>(Click)(searchby=xpath)
//*[contains(@id,"parent_identity_identity_users")] > (click)(searchby=xpath)
//*[contains(@href,"/identity/users")] > (click)(searchby=xpath)
//*[text()="Change Password"] > (click)(searchby=xpath)
//*[contains(@value,"Save New Password")] > (click)(searchby=xpath)
09-28-2023 12:22 AM
Hi @Chris Noye ,
PSMDU019I Dispatcher trace message: [HTMLPageController :: FindElement -> Waiting until element '/html/body/div[1]/div/div/div[1]/form/dnx-textfield[1]/div/div/div/div/input' is found in page. Timeout: '30'.]
You can try to set more timeout, default 30s I think not enough.
cc timeout 60000. action timeout 30 , page load 60 , etc
10-01-2023 04:50 PM
Hi Trung,
That did not work unfortunately, I should say those settings work on every other web connector, I did expand the times you mentioned but it still has not worked. Is there a way of using the 'autocomplete="username"' or 'aria-label="Username" parameters as they are unique, always falls under the correct area and does not change when the page is refreshed.
Screenshot below:
The items in RED Change on every refresh "wthw" in the below screenshot changes to something new every time the page is loaded.
The items in Green do not change when the page is refreshed.
The arrow shows where i exported the full XPATH Value from.
Below is the current WebFormsFields configuration used (does not find the Xpath given)
/html/body/div^[1^]/div/div/div^[1^]/form/dnx-textfield^[1^]/div/div/div/div/input > {Username}(searchby=xpath)
/html/body/div^[1^]/div/div/div^[1^]/form/dnx-textfield^[2^]/div/div/div/div^[1^]/input > {Password}(searchby=xpath)
/html/body/div^[1^]/div/div/div^[1^]/form/dnx-button/button > (Button)(searchby=xpath)The latest error log from the webdispatcher log.
[HTMLPageController :: FindElement -> Waiting until element '/html/body/div[1]/div/div/div[1]/form/dnx-textfield[1]/div/div/div/div/input' is found in page. Timeout: '600'.]
I should note the page loads within 15 seconds, so I'm pretty sure the XPATH search is the issue, I suspect something needs to be added "here" to help it find the username input ?
/html/body/div[1]/div/div/div[1]/form/dnx-textfield[1 **** HERE **** ]/div/div/div/div/input'
Any other thoughts? Would it help if i sent the HTML example as text rather than a screenshot?
Thanks for your support so far, your help is always appreciated.
I am going to try to take the XPATH from the line above to see if that makes any difference but i still feel like it needs something to search for inside the XPATH. I will post back if it works.
Kind Regards,
Chris.
10-01-2023 06:55 PM
hi @Chris Noye ,
please send the HTML as text bro, I will try to customize it in my lab and provide feedback to you
10-01-2023 08:23 PM
Hi Trung, HTML is below Remember any ID that contains "61j2" in this case will change on refresh.
<body class="apic" style="background: url("/dist/core/widgets/login/img/login_background_003.e78d5fd9a9a3d5d1061de80531d4a224.jpg");">
<div id="apicloginBoxHolder" class="overlay">
<div id="apicloginBox"><div class="login-box-container"><div class="login-box"><span class="icon-cisco" aria-hidden="true"></span><div class="brand-title"><div class="branding-strong">Cisco</div><div class="branding-sub">DNA Center</div></div><div class="branding-description">The bridge to possible</div><form class="fields"><dnx-textfield label="Username" placeholder="" value="" name="0e2n" hint="" maxwidth="300px" error="" regex="" message="" validator="" regextype="" type="text" validateon="onblur" hinthelper="" inputid="0e2n" errorhelper="" expandable="" showhide="" source="none" errormsg="" maxlength="2000" autocomplete="username" arialabel="" defined="" data-testid="login-username" data-analyticsid="dnx-textfield[id='login-username']"><div><div style="display: flex; flex-direction: row;"><div class="dnx-shadow form-group floating-label " style="width: 300px;"><div id="dnx_inputfield_container0e2n" class="dnx_inputfield_container"><input id="0e2n" class="form-control deleteiconfalse " type="text" placeholder="" autocomplete="username" data-testid="dnxTextfield-input" maxlength="2000" aria-label="Username" aria-required="false" aria-invalid="false"></div><label class="control-label " for="0e2n">Username</label><small> </small></div></div></div></dnx-textfield><dnx-textfield label="Password" placeholder="" value="" name="61j2" hint="" maxwidth="300px" error="" regex="" message="" validator="" regextype="" type="text" validateon="onblur" hinthelper="" inputid="61j2" errorhelper="" expandable="" showhide="" source="none" errormsg="" maxlength="2000" autocomplete="current-password" arialabel="" defined="" data-testid="login-password" password="" data-analyticsid="dnx-textfield[id='login-password']"><div><div style="display: flex; flex-direction: row;"><div class="dnx-shadow form-group floating-label " style="width: 300px;"><div id="dnx_inputfield_container61j2" class="dnx_inputfield_container"><input id="61j2" class="form-control password " type="password" placeholder="" autocomplete="current-password" data-testid="dnxTextfield-input" maxlength="2000" aria-label="Password" aria-required="false" aria-invalid="false"></div><label class="control-label " for="61j2">Password</label><div class="password-container"><span class="show-hide dnx-empty" tabindex="-1" data-testid="dnxTextfield-passwordShowHideIcon"></span></div><small> </small></div></div></div></dnx-textfield><dnx-button data-testid="login-submit" type="submit" label="Log In" disabled="" data-analyticsid="dnx-button[id='login-submit']"><!----><!----><button type="submit" id="c1kn" class="btn wc-btn--primary big disabled" aria-label="Log In" data-label="Log In" disabled="" aria-disabled="true">Log In</button><!----><!----></dnx-button></form></div><div class="login-message-container"><div class="login-message">WARNING - AUTHORISED USERS ONLY
Under Australian law, it is a criminal offence to:
i. Obtain access to data without authority
ii. Damage, delete, alter or insert data without authorityThe HTML for the login page is 20,000 lines I've tried to grab the area suited as I can't seem to find any upload Function within this posting area?
03-06-2024 12:00 AM
Hi @Chris Noye have you resolve it? I have the same issue.
02-18-2025 09:41 AM
Any update on this one? I have the same issue. Assume you can use autoit to send the clicks but curious if anyone found any solutions?
03-17-2025 06:56 AM
Hi, I have the same issue.
03-18-2025 04:36 AM
Hi,
I have got the same issue
Please let us know if anyone find the solution
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

