selenium

How to do Mouse hover on Image in selenium web driver to get menu list

会有一股神秘感。 提交于 2021-02-10 03:06:21
问题 I am trying to mouse hover on image to display menu list. My HTML code is: <img id="logo" src="/web/images/header/img_Logo_Topbar.png"> But I am trying Xpath as "//*[@id='logo']" . There is no response. I am using this script: Actions a1 = new Actions(driver); a1.moveToElement(driver.findElement(By.xpath("//*[@id='logo']"))) .build() .perform(); Thread.sleep(1000L); 回答1: It's looks like a bug, I'm not sure what is the solution for this but if you want alternate solution to perform mouse hover

How to do Mouse hover on Image in selenium web driver to get menu list

走远了吗. 提交于 2021-02-10 03:06:05
问题 I am trying to mouse hover on image to display menu list. My HTML code is: <img id="logo" src="/web/images/header/img_Logo_Topbar.png"> But I am trying Xpath as "//*[@id='logo']" . There is no response. I am using this script: Actions a1 = new Actions(driver); a1.moveToElement(driver.findElement(By.xpath("//*[@id='logo']"))) .build() .perform(); Thread.sleep(1000L); 回答1: It's looks like a bug, I'm not sure what is the solution for this but if you want alternate solution to perform mouse hover

selenium 自动化工具

允我心安 提交于 2021-02-09 09:56:44
问题 今天在使用 selenium + PhantomJS 动态抓取网页时,出现如下报错信息: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless ' 翻译过来就是:selenium已经放弃PhantomJS,了,建议使用火狐或者谷歌无界面浏览器。 解决办法: 我们就改用 Selenium + Headless Chrome 1.安装Chrome浏览器 2.安装Selenium pip install selenium 3.安装chromedriver chromedriver下载地址: https://sites.google.com/a/chromium.org/chromedriver/downloads (被墙了) http://npm.taobao.org/mirrors/chromedriver/(可用) 注意 :chromedriver的版本要与你使用的chrome版本对应,对应关系: 点击链接 下载完成后

Codeception - Can't connect to Webdriver (Acceptance Test)

半腔热情 提交于 2021-02-09 09:20:44
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

Codeception - Can't connect to Webdriver (Acceptance Test)

江枫思渺然 提交于 2021-02-09 09:20:20
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

Selenium辅助工具

孤者浪人 提交于 2021-02-09 09:01:52
下载Firefox39.0版本浏览器,安装firebug和FirePath。最新版的Firefox在扩展组件中无法找到firebug,可以使用旧的版本的Firefox浏览器。 FirePath插件的使用: 1)使用手写XPath和CSS方式查找页面元素 启用Firefox浏览器,访问www.baidu.com网页。 启动Firebug插件,单击“FirePath”标签栏显示FirePath的使用界面。 在上图输入框中输入 XPath定位表达式“ //input[@id=" kw" ]” ,或者CSS定位表达式“input#kw”,查找页面中input标签的id 属性为“ kw”的输入框,回车 后,在 FirePath插件的代码显示区域会显示查找到的页面元素的 HTML代码,在网页显示区域中,搜索输入框以虚线框样式显示: 2)使用 FirePath插件获取页面元素的 XPath和CSS表达式 启动 FirePath浏览器,访问http://www.baidu.com 网页。 启动 Firebug插件。 在百度首页搜索框上方单击鼠标右键,在弹出的快捷菜单中选择“使用 Firebug查看元素”命令: 此时在Firebug插件的HTML标签区域高亮显示搜索框对应的HTML代码,选择高亮代码,右键然后点击复制XPath或者复制CSS路径,粘贴到文本文件中即可看到XPath或者CSS表达式:

Cannot read property 'click' of undefined while using Java Script Executor in Selenium

孤者浪人 提交于 2021-02-09 01:49:50
问题 I am getting an error: Cannot read property 'click' of undefined while trying to click a button using java script executor. I have tried many different approach to click the button using action classes, webdriverwait etc but none seems to work.Java Script is working in console but when i am using in my code i am unable to click the button and getting the mentioned error The html dom looks as below: <div> <a class="button button--new-resource" href="/admin/certificate_types/new"> <img src="

Cannot read property 'click' of undefined while using Java Script Executor in Selenium

心不动则不痛 提交于 2021-02-09 01:47:55
问题 I am getting an error: Cannot read property 'click' of undefined while trying to click a button using java script executor. I have tried many different approach to click the button using action classes, webdriverwait etc but none seems to work.Java Script is working in console but when i am using in my code i am unable to click the button and getting the mentioned error The html dom looks as below: <div> <a class="button button--new-resource" href="/admin/certificate_types/new"> <img src="

Cannot read property 'click' of undefined while using Java Script Executor in Selenium

ぐ巨炮叔叔 提交于 2021-02-09 01:46:49
问题 I am getting an error: Cannot read property 'click' of undefined while trying to click a button using java script executor. I have tried many different approach to click the button using action classes, webdriverwait etc but none seems to work.Java Script is working in console but when i am using in my code i am unable to click the button and getting the mentioned error The html dom looks as below: <div> <a class="button button--new-resource" href="/admin/certificate_types/new"> <img src="

Selenium: how to click on javascript button

非 Y 不嫁゛ 提交于 2021-02-08 23:45:05
问题 I must write some scripts for automatic tests to check load-time a web application built in flex/amf technology. The test will consist in opening the IE browser, going through several tabs and measuring the time from clicking on the last tab to load the page content and then closing the browser. I wrote in java a small script with Selenium Web Driver and Junit. Script opening the IE-window, enter login and password. I have problem with 'click on' login-button. Firstly I have try to find and