Issue with XPath

#1

Hello,

I have problems with XPath… I have a form in which I want to get and set values. I give the XPath given by Firefox (which is //input[@id=‘SMSGestion’]) in the Mouse Click Event, or web event, but nothing happens and I really doesn’t understand why. Indeed, it doesn’t give me any error and performs as if it worked, that is, it doesn’t stop and when the program stops running I have green check even though it didn’t click on the XPath.
The XPath is not in an iframe.

I hope I’m clear, don’t hesitate if you have any questions !

Thank you in advance

#2

Hi, @marion_delalan
Please, provide screenshot of webpage and your script
I did not really get what you are trying to do

If you simply click on input field nothing should happen
You can either

  1. Click on input
  2. Enter keystrokes
    Or
    Set value by xpath from variable (Web element action)
#3

Actually, the problem is already slightly different from 10 minutes ago but the idea is the same :
I want to get the value in “e-mail” and put them in the field right above (cirled in red). To do so, I get the value from the XPath of the mail input and set it to the XPath of the tel input. The “click mouse” on the XPath “//input[@id=‘cusema’]” works perfectly but the Web Element doesn’t get the value in the variable…

#4

You copy email to telephone - seems a little unusual, because typically telephone field does not allow letters and @ symbols. That might be the root problem.

#5

No it’s not. It’s actually written “tel” field but I tried “by hand” and I can write letters and symbols without problems. I did that only to try because since the flow doesn’t stop (it doesn’t detect any problem), I have to set the variable value somewhere to see what’s inside. The tel field is the only field which is not hidden in this form. Moreover, I have this issue not only on this form but also on others forms in other website. The Web Element doesn’t get the value in the variable.

#6

Please post your zipped recording folder here. Thanks.

#7

Web Element can get value only if it placed inside of tags, if its an attribute value - try to get attribute (from web element)

Also, as a workaround you can use clipboard action

  1. Click in field by xpath
  2. Enter Keystrokes - CTRL+a
  3. Enter keystrokes - CTRL+c
  4. Clipboard action - set variable from clipboard
1 Like
#8

Thank you very much, that worked ! For those having the same problem, you have to click on “use element attribute” and set if you want to get the id, or the name, or the value…

1 Like