We know that senhasegura provides Tags so that we can, during an automated authentication, enter the current values of the credential, such as username, password, additional information and the like.
However, what if I need to insert other variables where they are not necessarily registered in the data described above the credential?
For that, you can use the “Extra fields” of a credential, being able to create variables and configure static values.
Let’s exemplify this. Imagine AWS, when logging into the IAM console, you need to enter an ID, right? How can we use this functionality for this scenario?
It’s quite simple! In the credential, just create the following configuration:
Let’s create a web session parameter that does this automatically for us!
First, identify which elements you need to interact with and which selectors, in my case, we will use jquery for this.
So my web session parameter will look like this:
Did you notice the “[id]” there? At runtime, senhasegura will insert the variable’s value in the input of the HTML page!
When starting an HTTPS session with this credential, we get the expected result: