selenium-webdriver

How to write a CSS Selector selecting elements NOT having a certain attribute?

久未见 提交于 2021-01-27 02:50:05
问题 How to write a CSS Selector selecting elements NOT having a certain attribute? I have 2 <div> nodes as follows: First: <div class="weEq5" style="will-change; width;"> <button class="_35EW6"> Second: <div class="weEq5"> <button class="_35EW6"> I need to select the <div> (with the similar class) and each of them which have a similar descending <button> but without the style attribute. XPath seems working fine as: //div[@class and not (@style)]/button I am looking for an equivalent CssSelector .

Python Selenium - click on element purely based on its location based on body element offset

寵の児 提交于 2021-01-24 11:24:06
问题 I have a question that was somehow discussed here ([python][selenium] on-screen position of element) but that doesn't currently do what I'm trying to achieve. My goal is the following: element.location gives the position of the top left corner of element in the browswer. I have a website in which, even if it's probably not a good selenium practice, I want to be able to click on such element purely based on its position because it has never changed and likely never will. Assuming element

selenium.common.exceptions.TimeoutException: Message: Timed out waiting for page to load using IEDriverServer and Internet Explorer through Selenium

南笙酒味 提交于 2021-01-24 11:16:24
问题 Given this code : from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.support.ui import Select from selenium.webdriver.common.by import By # import org.openqa.selenium.Keys import datetime import time import unittest cap = DesiredCapabilities().INTERNETEXPLORER cap['ignoreProtectedModeSettings'] = True cap['IntroduceInstabilityByIgnoringProtectedModeSettings'] = True cap['nativeEvents'] = True cap[

selenium.common.exceptions.TimeoutException: Message: Timed out waiting for page to load using IEDriverServer and Internet Explorer through Selenium

若如初见. 提交于 2021-01-24 11:16:06
问题 Given this code : from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.support.ui import Select from selenium.webdriver.common.by import By # import org.openqa.selenium.Keys import datetime import time import unittest cap = DesiredCapabilities().INTERNETEXPLORER cap['ignoreProtectedModeSettings'] = True cap['IntroduceInstabilityByIgnoringProtectedModeSettings'] = True cap['nativeEvents'] = True cap[

How to Enter text in rich text editor in selenium webdriver?

此生再无相见时 提交于 2021-01-21 11:56:27
问题 We have a rich text editor in our application which we are automating using selenium . Below is the html for the same . <iframe style="height: 76px; width: 1004px;"></iframe> <html><head></head><body spellcheck="false"></body></html> <head></head> <body spellcheck="false"></body> <html><head></head><body spellcheck="false"></body></html> <iframe style="height: 76px; width: 1004px;"></iframe> <div class=""><iframe style="height: 76px; width: 1004px;"></iframe></div> <textarea class="form

How do I fix the TypeError raised when trying to find an element using Selenium?

一曲冷凌霜 提交于 2021-01-21 09:23:46
问题 I am trying to scrape all the links from a web page. I am using Selenium WebDriver to scroll and click the load more button present in the web page. The code which I am trying is as shown below: from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import ElementNotVisibleException from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import NoSuchElementException from bs4 import

selenium.JavascriptException: javascript error: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite

…衆ロ難τιáo~ 提交于 2021-01-21 07:10:28
问题 using chrome 78 and chromedriver78 When i click an audio file or try to stop an audio using selenium tests i am getting this error. Error: org.openqa.selenium.JavascriptException: javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite. Note it happens only with remote webdriver and its not consistent. Error stack trace: When the audio player of the "item_1" element is stopped in "[data-rcfid='checkbox_7']" org.openqa.selenium

how to enter numeric value into textbox in webdriver

主宰稳场 提交于 2021-01-21 06:15:10
问题 How to enter numeric value into textbox in Selenium webdriver. The code is below: sendKeys() method is not working for numeric value, is there any alternative command for the integers. @FindBy(id="toolbox-options-key") private WebElement BillingRateTextBox; public void createNewBill(String billingRate) { BillingRateTextBox.sendKeys(10); } 回答1: You need to convert the Integer to String and pass them to sendKeys like this: element.sendKeys(String.valueOf(number)) 回答2: running this: paris