selenium

Looping through rows of a table while clicking links in selenium (python)

送分小仙女□ 提交于 2021-02-16 15:27:45
问题 The sample page source looks like this <div class='div1'> <table class="foot-market"> <tbody data-live="false"> <td class='today-name'/> </tbody> <tbody data-live="false"> <td class='today-name'/> </tbody> <tbody data-live="false"> <td class='today-name'/> </tbody> </table <table class="foot-market"> <tbody data-live="false"> <td class='today-name'/> </tbody> <tbody data-live="false"> <td class='today-name'/> </tbody> <tbody data-live="false"> <td class='today-name'/> </tbody> </table </div>

How to resolve java.lang.NullPointerException in Selenium with Cucumber?

a 夏天 提交于 2021-02-16 15:09:26
问题 Register.feature Feature: The Registration Page Background: Given The User is on the Registration Page Scenario: The User Should be able to Register When The User Enters Contact Information And The User Enters Mailing Information When The User Enters User Information ReisterSteps.java public class RegisterSteps { public WebDriver driver; @Given("^The User is on the Registration Page$") public void the_User_is_on_the_Registration_Page() throws Throwable { System.out.println("Background:- The

WebDriverException: disconnected: unable to connect to renderer even on providing correct path of latest chromedriver

我怕爱的太早我们不能终老 提交于 2021-02-16 14:52:37
问题 package Testing_Forum; import java.util.concurrent.TimeUnit; import org.openqa.selenium.PageLoadStrategy; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class XTR { public static void main(String arg[]) { System.getProperty("webdriver.chrome.driver,D:\\Important\\chromedriver_win32_important\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("https://www.google.com/"); driver.manage().window().maximize(); driver.manage().timeouts

Cannot cast WebElement to org.openqa.selenium.internal.Locatable

混江龙づ霸主 提交于 2021-02-16 14:35:08
问题 I am trying to automate resize a column from a table, by using Actions class this is my code: public boolean resizeColumn(String columnToResize, String toColumn) { try { WebElement column = findElement(columnResize, columnToResize); WebElement moveToPosition = findElement(columnByName, toColumn); waitUntilClickable(column); //click on resize getSupport().clickAndHold(column); .. ... In PageSupport class: public void clickAndHold(WebElement onElement) { Actions actions = new Actions(driver);

Python Selenium: Block-Title is not properly verified. (Magento Cloud)

折月煮酒 提交于 2021-02-16 11:27:52
问题 Details: Currently I am writing within a project based on Magento Cloud test cases with Python-Selenium. So far everything is fine. Currently I only have one problem, which I can't explain anymore. Actually it's only about the verification of a text. Or the verification of a block title within a profile page. I would like to secure multiple times, and thus define 2 different test cases. issues I always get the following message. selenium.common.exceptions.StaleElementReferenceException:

问卷星自动填写

谁说我不能喝 提交于 2021-02-16 05:46:44
前言 问卷星是一个大学生都在用的问卷采集工具,每到期末,朋友圈总会有一大波问卷席卷而来。 可不可以自动填呢,可以的,小编找了一份问卷,使用 python 实现了一下,成功得到了几份问卷。 问卷星的反爬还有点厉害,涉及到无限 debugger。 无限 debugger 问卷链接: https://www.wjx.cn/m/99634699.aspx 打开链接,打开开发者工具,过了几秒后,就会被打上断电,暂停掉: 点击运行又会跳回这个页面,怎么点都没用,代码都查看不了,这就是无限 debugger,要解决呢,这里介绍两种办法, 第一是最直接简单的,取消断点,但这样做的话自己要打断点调试就不可以了,有局限。 第二种使用 Fiddler 修改网页返回内容过滤掉debugger标签可以破解此套路。 对于问卷星,使用第一种就可以了点击取消断点,再点击运行,就可以检查元素了: 接下来就可以编写问卷填写逻辑了。 填写逻辑 对于此问卷,有多页,都是选择题,对于这种需求首先想到的是 selenium 咯,模拟浏览器自动填写。 另外的思路就是破解提交问卷后的请求,但这种有点难度,就选最直接的方法了。 问卷星的问题虽然有多页,但所有页的所有问题的代码都可以在第一页的代码中看到: 上图中是问题第一页,在这一页,查看源代码,发现问卷的 8 页的代码标签都在这了,所以不需要翻页去查看后面的问题了。

Selenium Find Element Based on String in Text or Attribute

爷,独闯天下 提交于 2021-02-16 04:27:31
问题 I'm trying to have Selenium find an element based on a string that can be contained in the element's text or any attribute, and I'm wondering if there's some wildcard I can implement to capture all this without having to use multi-condition OR logic. What I'm using right now that works is ... driver.findElement(By.xpath("//*[contains(@title,'foobar') or contains(.,'foobar')]")); And I wanted to know if there's a way to use a wildcard instead of the specific attribute (@title) that also

【Mac + Appium + Java1.8学习(三)】之IOS自动化环境安装配置以及简单测试用例编写(模拟器、真机)

梦想与她 提交于 2021-02-15 13:03:37
前提条件: =========================================== 1.Xcode版本为Xcode10及以上 2.Appium版本必须为1.9及以上,因为Xcode为10.0 3.appium-desktop 4.安装所需依赖库,包括: a.Homebrew b.Git c.node ( brew install node ) d.npm ( brew install npm ) e.carthage ( brew install carthage ) f.libimobiledevice(真机测试需要)( brew install libimobiledevice ) g.ios-deploy(真机测试需要)( brew install ios-deploy ) 5、WDA配置 =========================================== 上面的环境配置具体参考: 《 【Mac + Appium学习(一)】之安装Appium环境前提准备 》 《 【Mac + Appium + Python3.6学习(三)】之IOS自动化测试环境配置 》 环境: MacOS:10.13.6 Appium:1.9.1 Appium-desktop:1.7.1 Java:1.8 XCode:10.0 一、安装测试环境 1

Web scraping an “onclick” object table on a website with python

随声附和 提交于 2021-02-15 07:44:51
问题 I am trying to scrape the data for this link: page. If you click the up arrow you will notice the highlighted days in the month sections. Clicking on a highlighted day, a table with initiated tenders for that day will appear. All I need to do is get the data in each table for each highlighted day in the calendar. There might be one or more tenders (up to max of 7) per day. Table appears on click I have done some web scraping with bs4, however I think that this is a job for selenium (please,

Trying to upload multiple files to a website using Python and Selenium but only the first file is picked up and not the others, any idea why?

老子叫甜甜 提交于 2021-02-15 07:37:26
问题 Theyre actually PGP files but i dont think that matters much Not sure whats wrong with my script, im using Selenium and Glob as the main source of uploading and file manipulation. I have all my files set for variable and i also used the send.keys accurately, not sure why its only picking up the first instance of every file and not all of them. For Example, the directory folder that all of these are pointing too might have 2 or 3 of the "ack" file. When i execute this code it will only pick up