WebDriver拖动n拖放从Google搜索中选择的文本 [英] WebDriver Drag n Drop Selected text from Google Search

查看:57
本文介绍了WebDriver拖动n拖放从Google搜索中选择的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要的是,当我在电子邮件"框中键入用户名"并借助动作进行选择时,我通过双击文本来选择文本,并且希望将用户名"从电子邮件框中拖到名字框"中.

What I want is When I type "username" in Email Box and with the help of actions i am selecting the text by double clicking it and I want to drag the "username" from email box to Firstname Box .

有人可以帮我吗

推荐答案

如果您的目标是将相同的输入发送到两个字段,为什么不使用相同的String变量

If your aim is to send the same input to both the fields, why not use the same String variable

String username = "firstname";

.sendKeys(username);

.这样,您DragAndDrop不会进入现场,并且每次都会保证正确的结果.

to both the Webelements userName and firstName. That way you DragAndDrop won't come into scene and will guarantee proper results every time.

::可以自由命名变量. ::

:: Took the liberty to name your variables. ::

这篇关于WebDriver拖动n拖放从Google搜索中选择的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆