selenium-chromedriver

Disable image loading with PHP Selenium

老子叫甜甜 提交于 2019-12-13 20:25:03
问题 How do you disable image loading in ChromeOptions? (PHP library) I tried the following but not sure if syntax is correct $options = new ChromeOptions(); // disable images $options->addArguments(array( "service_args=['--load-images=no']" )); $caps = DesiredCapabilities::chrome(); $caps->setCapability(ChromeOptions::CAPABILITY, $options); $driver = RemoteWebDriver::create($host, $caps); 回答1: To disable, use the argument: --blink-settings=imagesEnabled=false $options->addArguments(array( '-

java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap while using WebDriver with Maven Dependencies in Java Selenium

别等时光非礼了梦想. 提交于 2019-12-13 19:08:11
问题 It is portion the code after driver=new ChromeDriver(); line it give me error i check with sysout, errors are in the 2, well i am not well experienced using Maven but i am checking my pom.xml file , i gave Selenium dependencies. -Any advice?, any helps appreciated public WebDriver initilizeDriver() throws IOException { Properties prop= new Properties(); FileInputStream fıs=new FileInputStream("C:\\Users\\Melih Sancak\\my-amazonTest\\src\\main\\java\\com\\ObjectRepisotary\\app\\data.properties

open 'href' variable in a new tab

淺唱寂寞╮ 提交于 2019-12-13 17:26:52
问题 I'm using selenium and chrome webdriver with python. I'm trying to store 'href' inside a variable ('link' for this example) and open it in a new tab. i know how to open a dedicated website in a new tab using this way: driver.execute_script("window.open('http://www.example.com', 'newtab')") but using windows.open script accepts only direct text(as far as i know) and not variables. Here is the code: link = driver.find_element_by_class_name('asset-content').find_element_by_xpath(".//a[@class='mr

Error on running chromedriver in CentOS 6.6

南楼画角 提交于 2019-12-13 17:21:20
问题 I tried chmod+x chromedriver and chmod 777 chromedriver then ./chromedriver it throws error: /usr/lib64/libstdc++.so.6:version 'GLIBCXX_3.4.15' not found (required by ./chromedriver) /usr/lib64/libstdc++.so.6:version 'CXXABI_1.3.5' not found (required by ./chromedriver) /usr/lib64/libstdc++.so.6:version 'GLIBCXX_3.4.14' not found (required by ./chromedriver) Any idea to to fix this? Thanks! 来源: https://stackoverflow.com/questions/42948023/error-on-running-chromedriver-in-centos-6-6

how to stop selenium chromedriver from logging to the screen

雨燕双飞 提交于 2019-12-13 16:16:25
问题 How do I stop selenium chromedriver from logging errors to the screen? I am running some cucumber tests and Im using capybara & the selenium chromedriver to drive the tests. In the last few weeks ive noticed that the Chromedriver has started logging its error messages to the screen. My tests still run fine but the errors are clogging up the output. This is the output below: Started ChromeDriver port=9515 version=23.0.1240.0 log=C:\Gitrepos\Base Tests\chromedriver.log [8244:5080:1115/151428

Default profile name in Chrome when using Watir-Webdriver?

六眼飞鱼酱① 提交于 2019-12-13 15:50:46
问题 I downloaded the Chromedriver then I extracted it to the right place (usr/bin), but I don't know what is the default profile name for the Chrome (Chromium) browser, so this line throw an error message: browser = Watir::Browser.new :chrome, :profile => "default" I tried either "current" or my username instead of "default", but none of them worked. How can I start Chrome with my default profile? Because I don't want to start a new profile without the usual preferences, and saved passwords,

Selenium WebDriverException: Message: unknown error: cannot determine loading status from unknown error: missing or invalid 'entry.level'

房东的猫 提交于 2019-12-13 15:21:42
问题 I have a script which uses selenium for testing. Now even opening a Google page using driver.get(url) # url = Google homepage url is giving me below error driver.get("https://my.gumtree.com/login") File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 245, in get self.execute(Command.GET, {'url': url}) File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 233, in execute self.error_handler.check_response(response) File "C:\Python34\lib

Selenium Python get_element by ID failing

不问归期 提交于 2019-12-13 12:51:48
问题 Can someone help me understand why my code fails to find the element by ID. Code below: from selenium import webdriver driver=webdriver.Firefox() driver.get('https://app.waitwhile.com/checkin/lltest3/user') element = driver.find_element_by_id("guestPhone") Inspecting element shows the ID clearly. <input type="tel" name="guestPhone" id="guestPhone" class="form-control ng-pristine ng-empty ng-invalid ng-invalid-phone-validator ng-invalid-required ng-touched" ng-model="form.model" ng-model

Strange error in selenium after upgrading to chromedriver 2.28 needed for chrome 57

蓝咒 提交于 2019-12-13 11:33:55
问题 After being forced to upgrading to chromedriver 2.28 to use selenium with chrome 57, I get the following error message: [0313/100022.689:ERROR:child_thread_impl.cc(762)] Request for unknown Channel-associated interface: ui::mojom::GpuMain Any ideas on what might this be about? Chromedriver: 2.28 Chrome: 57 Webdriver: 3.3 node: 6.10 回答1: See this answer to my question. This resolved my issue. "Try the --disable-gpu switch. Chrome seems to have a problem with initializing the GPU. I had the

No such Element Exception using selenium in python

▼魔方 西西 提交于 2019-12-13 10:16:27
问题 from selenium import webdriver from selenium.webdriver.common.keys import Keys chrome_path=r"C:\Users\Priyanshu\Downloads\Compressed\chromedriver_win32\chromedriver.exe" driver=webdriver.Chrome(chrome_path) driver.get("https://www.flipkart.com/?") search = driver.find_element_by_name('q') search.send_keys("laptop") search.send_keys(Keys.RETURN) driver.find_element_by_xpath(""" //*[@id="container"]/div/div[2]/div[2]/div/div[2]/div[2]/div/section/ul/li[2]""").click() I am getting no such