我正在编写用于单击链接的代码,如下所示:
<a style="left: 520px; top: 340px; height: 24px; color: blue; position: absolute;" href="Login.aspx?iUserFlag=1">
文本:以其他用户身份登录?
我写成:
Selenium.click(“link = Sign in as different user?”);
但是我无法点击,有人可以帮忙吗?
用于此的 HTML 片段是
<A style="POSITION: absolute; HEIGHT: 24px; COLOR: blue; TOP: 340px; LEFT: 520px" href="http://kaizenblitz/Login.aspx?iUserFlag=1">Sign in as different user?</A>
我在执行时收到的错误消息是:
Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: Element link = Sign in as different user? not found
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:109)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:103)
at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:193)
at seleniumproject.gmail.main(gmail.java:19)
谁能告诉我为什么我无法点击链接?