[英]How do I pass control of a browser from one selenium java client to another?
I have some scripts (in fitnesse) that executes some selenium commands. 我有一些脚本(适合运行),可以执行一些硒命令。 However, there are some processes wherein it would be too complex (or hackish) with a plain selenium (+fitnesse) approach, so I'm planning to create my own class which will handle those complex processing (ie check if the items in the table are sorted in ascending date). 但是,在某些过程中,使用普通的硒(+ fitnesse)方法可能会太复杂(或有些杂乱),因此我打算创建自己的类来处理那些复杂的处理(即,检查是否存在表按升序排序)。
This class would then have to take control of the browser that the first selenium java client has launched (ie after logging in, navigating to some pages, doing some other actions), and then do its specialized actions. 然后,此类将必须控制第一个Selenium Java客户端启动的浏览器(即登录后,导航到某些页面,执行一些其他操作),然后执行其专门的操作。
How would I be able to do that with the selenium java client? 我将如何使用Selenium Java客户端做到这一点?
Generally speaking you can do this if you have the Selenium session ID. 一般来说,如果您具有Selenium会话ID,则可以执行此操作。 The session ID is how the Selenium server associates a command with a particular browser. 会话ID是Selenium服务器将命令与特定浏览器关联的方式。
As for how you go about passing that around or using it in the Java client, I'd dig into the javadocs. 至于如何传递或在Java客户端中使用它,我将深入探讨javadocs。 But I do this in Ruby and it works quite well. 但是我在Ruby中执行此操作,效果很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.