webdriver

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

Select an option using python from select2 and fill web form

谁说胖子不能爱 提交于 2021-02-08 10:09:51
问题 I have this html code from select2 script: <div class='round10'> <select class='select2-authors-multiple' name='author[]' id='author' multiple style='width: 100%;'></select> and this from same page: <div class='round10'> <select class='select2-narrators-muliple' name='narrator[]' id='narrator' multiple='multiple' style='width: 100%;'></select> From firefox inspector i get this: <input class="select2-search__field" type="search" tabindex="0" autocomplete="off" autocorrect="off" autocapitalize=

How to swith to iframe inside shadow dom with selenium

此生再无相见时 提交于 2021-02-08 09:53:39
问题 Application under test is based on Electron (version 9.1.1) written as desktop application for Linux. In electron there are custom tag <webview> that is quote "The webview tag is essentially a custom element using shadow DOM to wrap an iframe element inside it." I can access shadow dom and get iframe as WebElement out of it with Java selenim(version 3.141.59). But swithcing to iframe still left me on parent context. And my question is: HOW TO SWITH TO IFRAME INSIDE SHADOW DOM? //getting

How to enable 'Mircophone' access in Edge browser using Selenium?

回眸只為那壹抹淺笑 提交于 2021-02-08 08:50:13
问题 I understand there are various flags/parameters you can pass using desired caps to enable access to camera, microphone, etc. For instance on Chrome you can use ChromeOption and pass ' profile.default_content_setting_values.media_stream_mi ' under ' prefs '. I wish to enable the microphone access on Edge browser. I am not able to find any related information. Can somebody assist me here? For Chrome you can enable the same like mentioned here- How to allow or deny notification geo-location

How to use xpath for extracting text between <br/> tag

半世苍凉 提交于 2021-02-08 08:40:30
问题 Following is the code of a button in my application. <span class="ms-cui-ctl-largelabel" unselectable="on"> New <br> Map </span> </a> </span> I want to click on that button and using Selenium Webdriver for it. I tried multiple combinations but it's not working for me. Following are the different xpaths which I tried 1. By.xpath("//span[contains(@class, 'ms-cui-ctl-largelabel') and text() = 'New/nMap']")); 2. By.xpath("//span[contains(@class, 'ms-cui-ctl-largelabel') and text() = 'New/r/nMap']

webdriver modal window click() not working

孤街醉人 提交于 2021-02-08 03:41:38
问题 I've been browsing around trying to find a solution to this but none of the solutions have worked for me thus far. Here is a quick test I've thrown together where its simply trying to click the 'close' button to close a modal pop up. I can step through my test in Visual Studio and it will work fine. When I run the test in Nunit, it will error. I've tried the following based upon others issues and suggestions given to them:- putting in waits all over the place changing from the chrome driver

Finding elements by CSS selector with ChromeDriver (Selenium) in Python

允我心安 提交于 2021-02-08 03:06:54
问题 I'm using ChromeDriver of Selenium with Python and I'm trying to find a button on my page that has the following HTML: <input id="j_id0:SiteTemplate:j_id255:new" type="submit" name="j_id0:SiteTemplate:j_id255:new" value="New" class="kbutton-white"> The only thing I know being constant is the id and name ending with "new" and I'm trying to use the following code to identify and click that element: test_runner.driver.find_element_by_css_selector('[id*=new]').click() However, I get this error

Finding elements by CSS selector with ChromeDriver (Selenium) in Python

纵饮孤独 提交于 2021-02-08 03:01:32
问题 I'm using ChromeDriver of Selenium with Python and I'm trying to find a button on my page that has the following HTML: <input id="j_id0:SiteTemplate:j_id255:new" type="submit" name="j_id0:SiteTemplate:j_id255:new" value="New" class="kbutton-white"> The only thing I know being constant is the id and name ending with "new" and I'm trying to use the following code to identify and click that element: test_runner.driver.find_element_by_css_selector('[id*=new]').click() However, I get this error

Finding elements by CSS selector with ChromeDriver (Selenium) in Python

我的未来我决定 提交于 2021-02-08 03:00:51
问题 I'm using ChromeDriver of Selenium with Python and I'm trying to find a button on my page that has the following HTML: <input id="j_id0:SiteTemplate:j_id255:new" type="submit" name="j_id0:SiteTemplate:j_id255:new" value="New" class="kbutton-white"> The only thing I know being constant is the id and name ending with "new" and I'm trying to use the following code to identify and click that element: test_runner.driver.find_element_by_css_selector('[id*=new]').click() However, I get this error

Simulate Click event using selenium in python

浪尽此生 提交于 2021-02-07 10:20:44
问题 I am scraping some data from this link https://www.vbgov.com/property-search#DetailView=14760123360000. But i am unable to simulate click event on "Sales History & Tax Information" tab using webdriver Selenium and python. driver.get("https://www.vbgov.com/property-search#") searchBox1 = driver.find_element_by_id("consolidated-search-query") searchBox1.send_keys("1124 LUKE DR") searchBox1.send_keys(Keys.ENTER) driver.implicitly_wait(5) link = driver.find_element_by_xpath('//*[@id="property"]