发送密钥时我收到以下错误.
结果消息:
System.InvalidOperationException : unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.14393 x86_64)
Run Code Online (Sandbox Code Playgroud)
我已将chrome驱动程序更新为2.36,但仍然我的代码搜索2.33?
任何的想法 ?
selenium google-chrome webdriver python-2.7 selenium-webdriver
我们正在考虑将我们的生产服务器从Ubuntu- desktop 10.04 升级到Ubuntu- server 12.04.
我们在当前的桌面操作系统上运行各种服务,例如Selenium Web Driver.我的问题是Selenium Web Driver可以从基于cli的系统运行吗?
我的直接想法是,它不能,因为它依赖于Firefox,但我希望有人证明我错了!
出于某种原因,当我在工作中运行我的测试时,浏览器被最大化,但是当我在家中运行它时,它只打开一个宽度约为50%的浏览器窗口.这会导致向下滚动等一些差异,所以我最好让它在运行测试的每台机器上打开一个相同大小的浏览器窗口.最好的方法是什么?(我已经找到了其他语言的一些答案,但还没能使它们适应javascript)
添加
browser.executeScript('window.moveTo(0,0);'+
'window.resizeTo(screen.width, screen.height);');
Run Code Online (Sandbox Code Playgroud)
什么都不做,(显然window.moveTo并window.resizeTo没有铬支持).
javascript webdriver angularjs selenium-webdriver protractor
我已经使用Selenium2/WebDriver编写了测试,并希望测试HTTP请求是否返回HTTP 403 Forbidden.
是否可以使用Selenium WebDriver获取HTTP响应状态代码?
我正在研究Java Selenium-WebDriver.我补充道
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
Run Code Online (Sandbox Code Playgroud)
和
WebElement textbox = driver.findElement(By.id("textbox"));
Run Code Online (Sandbox Code Playgroud)
因为我的应用程序需要几秒钟来加载用户界面.所以我设置2秒implicitwait.但我无法找到元素文本框
然后我补充说 Thread.sleep(2000);
现在它工作正常.哪一种更好?
这是如何实现的?在这里它说java版本是:
WebDriver driver; // Assigned elsewhere
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("return document.title");
Run Code Online (Sandbox Code Playgroud)
但我找不到C#代码来做到这一点.
根据上一个问题,我将Selenium更新为2.0.1版但现在我有另一个错误,即使配置文件存在于/tmp/webdriver-py-profilecopy:
File "/home/sultan/Repository/Django/monitor/app/request.py", line 236, in perform
browser = Firefox(profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 46, in __init__
self.binary, timeout),
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 46, in __init__
self.binary.launch_browser(self.profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 44, in launch_browser
self._wait_until_connectable()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 87, in _wait_until_connectable
raise WebDriverException("Can't load the profile. Profile Dir : %s" % self.profile.path)
selenium.common.exceptions.WebDriverException: Can't load the profile. Profile Dir : /tmp/webdriver-py-profilecopy
怎么了?我该如何解决这个问题?
我有一个用Selenium测试的Web应用程序.页面加载时会运行很多JavaScript.
这段JavaScript代码编写得不是很好,但我无法改变任何东西.所以等待元素出现在DOM中的findElement()方法不是一种选择.
我想在Java中创建一个通用函数来等待页面加载,可能的解决方案是:
document.body.innerHTML在字符串变量中body.body变量与之前版本进行比较body.如果它们相同则设置增量计数器,notChangedCount否则设置notChangedCount为零.notChangedCount >= 10那么退出循环,否则循环到第一步.你认为这是一个有效的解决方案吗?
启动功能时
def run(driver_path):
driver = webdriver.Chrome(executable_path=driver_path)
driver.get('https://tproger.ru/quiz/real-programmer/')
button = driver.find_element_by_class_name("quiz_button")
button.click()
run(driver_path)
Run Code Online (Sandbox Code Playgroud)
我收到这样的错误:
def run(driver_path):
driver = webdriver.Chrome(executable_path=driver_path)
driver.get('https://tproger.ru/quiz/real-programmer/')
button = driver.find_element_by_class_name("quiz_button")
button.click()
run(driver_path)
Run Code Online (Sandbox Code Playgroud)
...但我不明白为什么。
我正在为我的 Chrome 版本使用最新版本的WebDriver 。我不知道为什么我得到
<ipython-input-27-c5a7960e105f>:6: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Chrome(executable_path=driver_path)
<ipython-input-27-c5a7960e105f>:10: DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
button = driver.find_element_by_class_name("quiz_button")
Run Code Online (Sandbox Code Playgroud)
...当文档中存在该命令时。
我有情况,当点击按钮打开带有搜索结果的新浏览器窗口时.
有没有办法连接并专注于新打开的浏览器窗口?
并使用它,然后返回到原始(第一)窗口.
webdriver ×10
selenium ×8
java ×4
c# ×2
javascript ×2
python ×2
angularjs ×1
findelement ×1
firefox ×1
httprequest ×1
httpresponse ×1
new-window ×1
protractor ×1
python-2.7 ×1
ubuntu ×1