使用C#在Selenium RC中按Enter键

Ran*_*ddy 5 c# selenium enter keypress selenium-rc

如何使用C#使用Selenium RC按Enter键?

我正在SearchBox使用Selenium。我必须在其中键入一些名称,并且必须按Enter进行搜索。

没有Submit按钮。因此,我必须使用Enter

我尝试过这样的事情

selenium.KeyPress("quicksearchtextcriteria", "13");
Run Code Online (Sandbox Code Playgroud)

但是不起作用。

请帮忙。

注意:我收集了执行此操作的可能方法的集合。参见此处:按Enter键输入硒

Pet*_*ček 5

可以通过Keys和来实现Enter

我不知道C#的Java示例:

import org.openqa.selenium.Keys;

//...

// this sends an Enter to the element
selenium.type("locator", Keys.ENTER);

// or even this - this sends the "Any text" and then confirms it with Enter
selenium.type("locator", "Any text" + Keys.ENTER);
Run Code Online (Sandbox Code Playgroud)

Keys枚举。