selenium-chromedriver

how to click button which is inside iframe using python selenium

試著忘記壹切 提交于 2020-01-06 07:23:08
问题 He is my sample snippet. i want to click the button-1034-btnIconEl using python selenium. <html> <body> <div class="x-container x-border-item x-box-item x-container-default x-layout-fit" id="iframes" > <iframe ></iframe> <iframe class="x-component x-fit-item x-component-default" frameborder="0" id="rpIFrame-1239"> <html> <body> <div> .....many divs <div> <a><span><span id="button-1034-btnIconEl"></span></span></a> </div> </div> </body> </html> </iframe> i tried this driver.switch_to.frame(1)

How to click on a Chrome extension button with Selenium

前提是你 提交于 2020-01-06 07:12:55
问题 I'm wondering if there is a way to click on an extension button with Selenium without using win32api. Here's the image, in the black circle is the extension icon which I'd want to click. That icon is located in the toolbar, so I don' know if there's a way to look for it with Selenium. 回答1: No, It is not possible with Selenium. The only way to achieve what you want to do is to use any automation tool that actually runs directly in the OS that you use. 回答2: You could work around this by using

Python 3, Selenium, Os - How to upload all images in folder

こ雲淡風輕ζ 提交于 2020-01-06 07:12:15
问题 I'm making an application (Windows 10 and selenium chromedriver) that makes an ad for me on an ad website, with all the details, and now I want to get to the part of uploading images for it. I'm trying something like: # Upload images # Change the directory from the current running project's directory # to the subsequent images folder os.chdir(os.getcwd()+"/images") # For each image that's in the folder for file in os.getcwd(): # Click the upload button on the website to open up the windows #

How to disable tabbed browsing, toolbar and address bar in selenium webdriver

纵然是瞬间 提交于 2020-01-06 05:27:48
问题 I want to driver chrome with web page only. 回答1: disable address bar ChromeOptions options = new ChromeOptions(); options.addArguments("--app=http://www.google.com"); driver = new ChromeDriver (options); check more chrome options here 来源: https://stackoverflow.com/questions/46233162/how-to-disable-tabbed-browsing-toolbar-and-address-bar-in-selenium-webdriver

C# - Selenium full page screenshot

房东的猫 提交于 2020-01-06 04:19:30
问题 I'd like to take a full page screenshot using C# with Selenium and ChromeDriver. Here: https://stackoverflow.com/a/45201692/5400125 I found an example how to do it in Java. I am trying to achieve this in C#, but I get an exception after page is loaded on the first call to sendEvaluate: OpenQA.Selenium.WebDriverException: 'no such session (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)' public class ChromeDriverEx :

chrome driver headless option is not working for link?

旧巷老猫 提交于 2020-01-05 08:27:45
问题 --headless option is not working for some link i don't know why by working for other links need of headless is i have to run this crawler on AWS instance to must required there is not GUI.. link= https://shop.nordstrom.com/s/pj-salvage-animal-lover-pajama-top-plus-size/5405170/full?origin=category-personalizedsort&breadcrumb=Home%2FWomen%2FClothing&color=charcoal Using Headless Option #for head less approch options = Options() options.binary_location = "/Applications/Google\ Chrome.app

How to use an existing google chrome profile with selenium chrome webdriver in python?

ぃ、小莉子 提交于 2020-01-05 07:34:51
问题 I need to load my full existing google chrome profile with all chrome extensions where i logged in google and site account. I'm struggling with this code, syntax error somewhere chrome_options = Options() chrome_options.add_argument('user-data-dir= C:\Users\DMMaxim\AppData\Local\Google\Chrome\User Data') capabilities = DesiredCapabilities.CHROME.copy() chromedriver = r"C:\Users\DMMaxim\Desktop\chromedriver_win32\chromedriver.exe" driver = webdriver.Chrome(executable_path=chromedriver, chrome

java.lang.ExceptionInInitializerError while working with chromedriver and chrome on linux

与世无争的帅哥 提交于 2020-01-05 07:33:33
问题 I'm creating tests(ui tests) on windows 10 machine. They works well, but few days ago my boss told me that we need to run our tests on linux. I'm downloaded linux driver and change it in System.setProperty("webdriver.chrome.driver", "chromedriver"); but after trying to run this test i got java.lang.ExceptionInInitializerError (it was latest driver with latest browser). After it i changed my code that allow me to run test, but connection to driver is remote. I don't like this way. May be some

Webdriver hangs when trying to handle alerts

拈花ヽ惹草 提交于 2020-01-05 05:03:46
问题 I'm using the code from this question. For some reason any time my test hits anything with an alert it will not return. It hits this: webDriver.switchTo().alert(); and then just spins forever, never returning. I expect the no alert present exception, but nothing happens. I've also tried this with no success. As soon as it hits the wait.until(ExpectedConditions.alertIsPresent()); it spins forever. I have noticed that if I close the browser manually it will skip past it without throwing an

Making System.setProperty platform independent in a Maven Project for Selenium Tests

廉价感情. 提交于 2020-01-04 16:56:14
问题 I am currently creating selenium automation using webdriver in Maven using Java. Now for initializing the browsers such as Chrome and IE I have to set the system property such as System.setProperty("webdriver.chrome.driver", "F:\\somewhereintheworkingdir\\drivers\chromedriver.exe"); Now, my deliverable is in terms of JAR. I am using maven so this is currently under main>resources>drivers>chromedriver.exe So after package it will be unders root>drivers>chromedriver.exe So How to make the