PSM Web Connector - Cisco DNA (ID= changes each time) Help

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

PSM Web Connector - Cisco DNA (ID= changes each time) Help

L1 Bithead

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.

 

Field_Content_versions_oct20__068Ht00000SC3Z1IAL.png

21 REPLIES 21

L3 Networker

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

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.

 

  1. There is no information on CSS syntax or an example of how it works.
  2. The XPATH explanation is limited with no real-world examples of how it works, can you use other tags or just ID=
  3. I've seen others used syntax such as text() function before the tag, cannot find any information on what that function does or how it works.
  4. The document could do with some more examples where the HTML code from the login page is shown against what the WebFormFields syntax is used to allow login. Some examples that are not just username > {username}{searchby=ID) maybe some examples that use XPATH, CSS and how to tackle different tags types etc..

 

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.

L3 Networker

Hi @Chris Noye​ ,

Let me show you how to use Xpath :

Field_Content_versions_oct20__068Ht00000SC3xyIAD.pngField_Content_versions_oct20__068Ht00000SC3y3IAD.png 

For XPath or full XPath, when using brackets [ ], include a caret (^) before each bracket like the image above

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.

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)

 

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.

Field_Content_versions_oct20__068Ht00000SC4UFIA1.pngcc timeout 60000. action timeout 30 , page load 60 , etc

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.

​

​

Field_Content_versions_oct20__068Ht00000SCU0gIAH.png​

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.

hi @Chris Noye​ ,

please send the HTML as text bro, I will try to customize it in my lab and provide feedback to you

 

Hi Trung, HTML is below Remember any ID that contains "61j2" in this case will change on refresh.

 

<body class="apic" style="background: url(&quot;/dist/core/widgets/login/img/login_background_003.e78d5fd9a9a3d5d1061de80531d4a224.jpg&quot;);"> <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=&#39;login-username&#39;]"><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>&nbsp;</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=&#39;login-password&#39;]"><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>&nbsp;</small></div></div></div></dnx-textfield><dnx-button data-testid="login-submit" type="submit" label="Log In" disabled="" data-analyticsid="dnx-button[id=&#39;login-submit&#39;]"><!----><!----><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 authority

The 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?

L0 Member

Hi @Chris Noye​  have you resolve it? I have the same issue.

L0 Member

any news on this ? same issue here. I think the input element is dinamically generated using javascript and cannot be accessed

L0 Member

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?

L0 Member

Hi, I have the same issue.

L0 Member

Hi,

I have got the same issue

 

Please let us know if anyone find the solution

  • 1048 Views
  • 21 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!