English 中文(简体)
如何使用 stelium Webdriver 获得浏览器会话片断Id
原标题:How to get browser sessionId using Selenium webdriver

我正使用网络驱动器(php-webdriver- constructions Yii 扩展),我正试图获取浏览器会话Id(测试将使用的版本 ) 。 我以为我可以通过 Webdriver 获得这个信息, 但情况似乎并非如此。 Webdriver 拥有一个会话Id, 但这不是测试浏览器正在使用的版本 。

我试图在测试前登入, 以便我的测试能成为验证用户, 让他们能访问我测试的网页。

我已经研究和测试了几天了,我损失惨重。如果有任何帮助,将不胜感激。

谢谢

问题回答

你可以投到混凝土类型,例如RemoteWebDriver,他们都继承了这些版本,并且还执行Saymond :

((RemoteWebDriver) driver).getSessionId()

我在爪哇遇到这个问题,但在仔细检查源代码时注意到,我使用的驱动程序被即时转换为 WebDriver 对象。在将其改为 RemoteWebDriver 对象后, .get Symond () 方法被暴露,而 driver.get Symond() 则按预期返回会话代号。

我不知道这如何翻译为 PHP, 但我建议回去检查以确保您的驱动程序是一个 < code> remoteWebDriver 对象, 而不是一个 < code> WebDriver 对象。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签