convert at symbol (“@”) to CharSequence

前端 未结 1 586
無奈伤痛
無奈伤痛 2021-01-19 14:53

I am testing site with selenium and I need to send an e-mail to one of the fields. So far I am using this Java method:

 String email = \"test@example.com\"
          


        
相关标签:
1条回答
  • 2021-01-19 15:24

    The following should work: String email = "test\u0040example.com";

    Apologies for misreading the question earlier.

    I think you will have to call sendKeys using the proper values from the Keys enum to simulate the way you get your at-sign. Use Keys.ALT with your "v" in a chord:

    sendKeys(Keys.chord(Keys.ALT, "v"));
    
    0 讨论(0)
提交回复
热议问题