selenium

Selenium: how to click on javascript button

こ雲淡風輕ζ 提交于 2021-02-08 23:44:13
问题 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

Is it possible to scrape a “dynamical webpage” with beautifulsoup?

╄→гoц情女王★ 提交于 2021-02-08 17:01:35
问题 I am currently begining to use beautifulsoup to scrape websites, I think I got the basics even though I lack theoretical knowledge about webpages, I will do my best to formulate my question. What I mean with dynamical webpage is the following: a site whose HTML changes based on user action, in my case its collapsible tables. I want to obtain the data inside some "div" tag but when you load the page, the data seems unavalible in the html code, when you click on the table it expands, and the

Is it possible to scrape a “dynamical webpage” with beautifulsoup?

孤人 提交于 2021-02-08 17:00:51
问题 I am currently begining to use beautifulsoup to scrape websites, I think I got the basics even though I lack theoretical knowledge about webpages, I will do my best to formulate my question. What I mean with dynamical webpage is the following: a site whose HTML changes based on user action, in my case its collapsible tables. I want to obtain the data inside some "div" tag but when you load the page, the data seems unavalible in the html code, when you click on the table it expands, and the

Not able to access bootstrap modal dialog in Selenium Webdriver

落花浮王杯 提交于 2021-02-08 14:59:31
问题 I want to Access the content of the model dialog box open, and want to access buttons (Yes,No). Here is HTML code looks like <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"><div class="bootstrap-dialog-header"> <div class="bootstrap-dialog-close-button" style="display: none;"> <button class="close">×</button> </div> <div class="bootstrap-dialog-title" id="e6adf6aa-dcbf-4fb8-9935-c083762f2812_title"> Inactivate user </div> </div> </div> <div class="modal-body">

Python+Selenium框架设计篇之-简单介绍unittest单元测试框架

戏子无情 提交于 2021-02-08 13:41:15
前面文章已经简单介绍了一些关于自动化测试框架的介绍,知道了什么是自动化测试框架,主要有哪些特点,基本组成部分等。在继续介绍框架设计之前,我们先来学习一个工具,叫unittest。 unittest是一个单元测试框架,是Python编程的单元测试框架。有时候,也做叫做“PyUnit”,是Junit的Python语言版本。这里了解下,Junit是Java语言的单元测试框架,Java还有一个很好用的单元测试框架叫TestNG,本系列只学习Python,所以只需要unittest是Python里的一个单元测试框架就可以了。 unittest支持测试自动化,共享测试用例中的初始化和关闭退出代码,在unittest中最小单元是test,也就是一个测试用例。要了解unittest单元测试框架,先来了解以下几个重要的概念。 测试固件(test fixture) 一个测试固件包括两部分,执行测试代码之前的准备部分和测试结束之后的清扫代码。这两部分一般用函数setUp()和tearDown()表示。这里举例以下,例如要测试百度搜索selenium这个场景,我们的测试固件可以这样写,setUp()里写打开浏览器,浏览器最大化,和打开百度首页等脚本代码;在tearDown()里写结束搜索后,退出并关闭浏览器的代码。 测试用例(test case) unittest中管理的最小单元是测试用例,一个测试用例

How to simulate Print screen button using selenium webdriver in Java

倖福魔咒の 提交于 2021-02-08 12:18:47
问题 How to simulate Print screen button using selenium web driver in Java Regards, Vignesh 回答1: selenium doesn't support it, only web page shots. However you can use Robot to do it try { String format = "jpg"; String fileName = printScreen." + format; Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); Robot robot = new Robot(); BufferedImage screenFullImage = robot.createScreenCapture(screenRect); ImageIO.write(screenFullImage, format, new File(fileName)); } catch

Python Selenium Traceback (most recent call last):

帅比萌擦擦* 提交于 2021-02-08 12:01:32
问题 I'm trying to use selenium for a python web scrapper but when I try to run the program I get the following error: "/Applications/Python 3.8/IDLE.app/Contents/MacOS/Python" "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 52548 --file /Users/xxxx/git/python/python_crawler_example_01/naver_crawling.py pydev debugger: process 3004 is connecting Connected to pydev debugger (build 192.7142.56) Traceback (most recent call last):

Python Selenium Traceback (most recent call last):

旧巷老猫 提交于 2021-02-08 12:01:29
问题 I'm trying to use selenium for a python web scrapper but when I try to run the program I get the following error: "/Applications/Python 3.8/IDLE.app/Contents/MacOS/Python" "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 52548 --file /Users/xxxx/git/python/python_crawler_example_01/naver_crawling.py pydev debugger: process 3004 is connecting Connected to pydev debugger (build 192.7142.56) Traceback (most recent call last):

How to send shortcut keys using selenium in python to move through webpage

心不动则不痛 提交于 2021-02-08 11:59:29
问题 I want to move through the all the posts and hitting like on the Facebook, and what I found out is we can move through every post pressing 'j' key on the keyboard and 'l' key to like the post. Now I want to automate this using selenium in Python. how can I accomplish this ? the code I tried is..(only lines which interact with the page) page=driver.find_element_by_tag_name('body') for i in range(10):#i am testing this so i tried to do this for 10 posts time.sleep(2) page.send_keys('j') time

Reading data from excel in selenium C#

浪尽此生 提交于 2021-02-08 11:15:49
问题 I'm trying to read username and password from excel sheet while using Selenium in C# .NET. Below is the code: using excel = Microsoft.Office.Interop.Excel; public void TestMethod1() { excel.Application xlApp = new excel.Application(); excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"D:\Test\TestData.xlsx"); excel._Worksheet xlWorksheet = **xlWorkbook.Sheets[1];** excel.Range xlRange = xlWorksheet.UsedRange; } I'm getting the following error at the text that is marked in bold in above code: