我尝试为记录的硒脚本编写一种解释器,它在我自己的数据结构中翻译硒脚本。更多解释:有人用硒记录了一个脚本,把它给我,然后我以某种方式解析它(没关系,这不是这里的问题)。
现在的问题是,我真的想将所有操作分组。每次 URL 更改时,我都希望有一个以完整 URL 作为组名称的新组。
问题是:我可以让 Selenium 在每次更改时记录新的 URL 吗?作为注释、命令或其他任何内容,我并不真正关心它是否在 selenium html 文件或/和导出格式中。
再次亲自运行脚本并记录 URL 是毫无疑问的,因为可能会记录一些重要的数据库更改。
i try to write a kind of interpreter for recorded selenium scripts, which translates a selenium script in my own datastructure. In more explenation: Someone records a script with selenium, gives it to me, and i parse it somehow (doesnt matter, this is not the problem here).
The Problem now is, that i really want to group all the actions. Every time the URL changes i want to have a new group with the complete URL as the group name.
The Question is: Can i get Selenium to record the new URL everytime it changes? As a comment, a command or whatever, i dont really care as long as it is in the selenium html file or/and an exported format.
Running the script myself again and recording the URLs is out of question since there could be some crucial database changes recorded.
发布评论
评论(1)
在 Selenium 的每一步之后询问当前的 URL 怎么样?
getCurrentUrl()
http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/WebDriver.html#getCurrentUrl%28%29What about asking the current URL after every step of Selenium?
getCurrentUrl()
http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/WebDriver.html#getCurrentUrl%28%29