Performing keyboard strokes “Ctrl + A” “Ctrl + C” and “Ctrl + V” on text field with selenium C#

為{幸葍}努か 提交于 2019-12-06 00:31:28
Arpan Buch
[FindsBy(How = How.Id, Using = "search-criteria")]
public IWebElement txtProductSearch1 = null

public void copypaste(string strCopy)
{ 
    txtProductSearch1.Click();
    txtProductSearch1.Clear();
    txtProductSearch1.SendKeys(strCopy);
    txtProductSearch1.SendKeys(Keys.Control + "a"); //a in smaller case
    txtProductSearch1.SendKeys(Keys.Control + "c"); // c in smaller case
    txtProductSearch1.Clear();
    txtProductSearch1.SendKeys(Keys.Control + "v"); // v in smaller case
    btnProductSearch1.Click();
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!