使用selenium-rc我可以加载页面,单击书签,并填写页内加载的表单?

时间:2022-10-06 22:57:34

Is there anyway by which I can automate the following steps in Selenium-rc

无论如何,我可以在Selenium-rc中自动执行以下步骤

  1. open a page
  2. 打开一个页面

  3. click on bookmarklet in browser toolbar
  4. 单击浏览器工具栏中的bookmarklet

  5. fill up data in the form loaded into the page by said bookmarklet.
  6. 通过所述bookmarklet填充加载到页面中的表单中的数据。

If the bookmarklet is not accessible as it is part of the browser/bookmark toolbar, is there a way in which I can inject the javascript into the page and have it execute?

如果小书签不可访问,因为它是浏览器/书签工具栏的一部分,有没有办法可以将javascript注入页面并让它执行?

1 个解决方案

#1


You are 99% there! You're right, you can't actually click the bookmarklet, but you can inject the same JavaScript in to the page. Simply use the getEval() command to evaluate the JavaScript.

你99%在那里!你是对的,你实际上无法点击书签,但你可以将相同的JavaScript注入页面。只需使用getEval()命令来评估JavaScript。

#1


You are 99% there! You're right, you can't actually click the bookmarklet, but you can inject the same JavaScript in to the page. Simply use the getEval() command to evaluate the JavaScript.

你99%在那里!你是对的,你实际上无法点击书签,但你可以将相同的JavaScript注入页面。只需使用getEval()命令来评估JavaScript。