Webform field username input element search

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

Webform field username input element search

L2 Linker

This is how the username input elements appears for different version of the same webapp:

<input id="input-:r0:" class="focus:tw-outline-none tw-border-none tw-w-full tw-p-0 placeholder:tw-text-neutral-300 tw-bg-neutral-0 dark:tw-text-neutral-800 dark:tw-placeholder-neutral-400 tw-text-lg" placeholder="Username" aria-invalid="false" title="Username" value="">   <input type="text" id="username" class="form-control" name="username" autocorrect="off" autocapitalize="off" autocomplete="off" autofocus="" placeholder="Username">

Will this match for both the username element variants above?

Username>{Username}(searchby=text)

Xpath and ID search works for only one or the other version. I'm looking for the webform syntax that will work for both versions of the webapp. The online documentation is not very clear on how exactly the "text" search/match works.

 

Thanks

1 accepted solution

Accepted Solutions

L2 Linker

Hi @Somidi Vamshi​ ,

 

Correct, FortiManager/Analyzer.

 

I was reluctant to use if-else conditional statements because in my experience it can add some delay to the connection time. It is working with the following:

//input^[@placeholder='Username'^]>{Username}(searchby=xpath) //input^[@placeholder='Password'^]>{Password}(searchby=xpath) Login>(Button)(searchby=text)

Thanks for your previous response.

 

Bryce

View solution in original post

5 REPLIES 5

L7 Applicator

Hi @BRYCE POWELL​ 

 

In this scenario, you will need to find a xpath and search using xpath.

 

 

Username>{Username}(searchby=xpath)

Username_XPath>//input[@placeholder='Username' or @title='Username']

 

Hope it helps !

 

L2 Linker

Hi @Malhar Vora​ ,

 

Thanks. Is this what you mean?

//input^[@placeholder='Username'^] > {Username}(searchby=xpath) //input^[@placeholder='Password'^] > {Password}(searchby=xpath) Login > (Button)(searchby=text)

I want to have high confidence in this before making a change in production that could break functionality.

 

Bryce

Hi @BRYCE POWELL​ 

 

As a best practice, I would not suggest to try directly the production without validating in the non-production environment.

 

It can impact your production users in case it doesn’t work as expected.

 

Please validate it in the non-production first.

 

Hope it helps!

L4 Transporter

Hi @BRYCE POWELL​ ,

 

Why can't you use if-else condition then ? It seems this is for fotigate web consoles.

 

 

if((username > (Condition) (SearchBy=name) (Exists eq True) ) ) 

//*^[@id="username"^] > {Username} (SearchBy=XPath) 

//*^[@id="password"^] > {Password} (SearchBy=XPath) 

//*^[@id="login"^] > (Button) (SearchBy=XPath) 

end-if 

else

 //*^[@id="input-:r0:"^] > {Username} (SearchBy=XPath) 

//*^[@id="input-:r1:"^] > {Password} (SearchBy=XPath)

 //*^[@id="id_layout_main"^]/div/div/div^[2^]/div^[5^]/button > (Button) (SearchBy=XPath) 

end-else

 

Thanks

L2 Linker

Hi @Somidi Vamshi​ ,

 

Correct, FortiManager/Analyzer.

 

I was reluctant to use if-else conditional statements because in my experience it can add some delay to the connection time. It is working with the following:

//input^[@placeholder='Username'^]>{Username}(searchby=xpath) //input^[@placeholder='Password'^]>{Password}(searchby=xpath) Login>(Button)(searchby=text)

Thanks for your previous response.

 

Bryce

  • 1 accepted solution
  • 300 Views
  • 5 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!