selenium

which chromedriver version supports electron app?

喜夏-厌秋 提交于 2021-01-28 19:56:44
问题 I try to run electron app using the following code: @Test public void testElectron() { System.setProperty("webdriver.chrome.driver", chromeDriverPath); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.setBinary(this.electronPath); WebDriver driver = new ChromeDriver(chromeOptions); } But I get the following error: Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) on port 37592 Only local connections are allowed. Please

Python Selenium - best way to capture element (Xpath or CSS selector) in this case (an input box)?

為{幸葍}努か 提交于 2021-01-28 19:50:57
问题 I am trying to scrape a website with selenium and I am using mostly xpath or CSS selector to grab elements. However I am noticing that these are dynamic (even though I read online that CSS selector shouldnt be) and I am having to re write the code often. I am fairly new to this and would like help figuring out what would be the best way to do this. Below is an example of an element that is an input box that I am trying to grab, I understand more definitive selectors like ID are more robust to

Selenium IDE not capturing the popup/ Alerts

这一生的挚爱 提交于 2021-01-28 19:46:02
问题 I am using selenium IDE to record the commands. I need to test the red rout for login screen. But Selenium is not recognizing the alert coming from the application. Highlighted in bold alert message is not captured by the selenium IDE. selenium.open("http://192.168.132.244:8080/SampleApp/"); assertEquals("SampleApp", selenium.getTitle()); selenium.type("name=userame", "NoUser"); --USER NAME selenium.type("name=password", "Password1"); --Password selenium.click("css=input[type=\"image\"]"); -

Java selenium getPageSource not working

不问归期 提交于 2021-01-28 19:39:16
问题 I need the source of the url given in the program. But the program returns oly some json data not the entire page source. What's the problem?? public class selenium { public static void main(String[] args) { selenium.loadPage("http://photos.filmibeat.com/celebs/kajal-aggarwal/photos-c14-e13421-p592995.html"); } public static void loadPage(String url) { WebDriver driver = new FirefoxDriver(); driver.get(url); String html = driver.getPageSource(); System.out.println(html); driver.quit(); } }

How to get parent element text and remove child element text selenium c#?

冷暖自知 提交于 2021-01-28 19:09:43
问题 i'm a newbie of automation testing, now i'm using selenium C#. I have a problem, i want to get text from a element, but the code : <div class="item"> Text1 <span>textdontwant</span> </div> and my statement driver.FindElement(By.XPath("//*[@id='contactList']/div[1]/div/div[1]/div/div/div/div[2]")).Text; Get: Text1textdontwant I need only parent element text is : Text1 Anyone have solution? Thanks so much! here HTML: <div id="contactList" class="web z-data-list" tabindex="30" style="position:

“TypeError: 'str' object is not callable” using WebDriverWait for link_text in Selenium through Python

夙愿已清 提交于 2021-01-28 19:04:32
问题 This is my first post on Stack Overflow. I have been browsing and searching for every possible answer to this question on SO, and I figured at this point I should just ask a question, as I have been at this wall for days now. I am currently working on a web scraping project with Selenium in Python. I have already scraped one website and am currently on the second, and I have run into a seemingly intractable issue. The following code works perfectly fine with no errors on the page https://www

Issue with scraping Understat chart data using Selenium

懵懂的女人 提交于 2021-01-28 18:54:25
问题 I'm trying to scrape chart data under 'Timing Sheet' tab at https://understat.com/match/9457. My approach is to use BeautifulSoap and Selenium but I can't seem to get it to work. Here is my python script: from bs4 import BeautifulSoup import requests # Set the url we want xg_url = 'https://understat.com/match/9457' # Use requests to download the webpage xg_data = requests.get(xg_url) # Get the html code for the webpage xg_html = xg_data.content # Parse the html using bs4 soup = BeautifulSoup

ChromeDriver is assuming that Chrome has crashed when passing profile arguments [duplicate]

别来无恙 提交于 2021-01-28 18:51:17
问题 This question already has answers here : How to open a Chrome Profile through Python (2 answers) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed with ChromeDriver and Selenium in Python (1 answer) Closed 2 years ago . If any Chrome processes are running and the following code is run, Stack Overflow will NEVER load: options = webdriver.ChromeOptions() options.add_argument("user-data-dir=C:\\Users\\RvBVakama\\AppData\\Local\\Google\\Chrome\

Unable to select value from autocomplete using protractor

六月ゝ 毕业季﹏ 提交于 2021-01-28 18:37:12
问题 <select name="Name" class="metaselect ignore" style="display: none;" xpath="1"> <option value="00000000-0000-0000-0000-000000000000" selected="selected">-- New --</option> <option value="bd434f35-90db-e911-aa59-a96c125b4266">AddtoTest</option> <option value="e8b6fd1b-e2f3-e911-aa64-e16c52c442dc">APINV_EPIC06</option> <option value="35cfdd50-c47a-e911-aa37-8fe9ba6f0d87">Approve</option> <option value="70da50aa-e2a3-e911-aa45-8f65b76e1edb">Basic</option> <option value="5af85ad8-5ac0-e911-aa4f

Attempting bi-dialect session, assuming Postel's Law holds true on the remote end & Falling back to original OSS JSON using ChromeDriver and Selenium

心已入冬 提交于 2021-01-28 18:35:13
问题 Below is a snippet of code I'm using to initialize chrome webdriver: System.out.println("Initializing Chrome"); ChromeOptions options = new ChromeOptions(); //options.setBinary("C:/Program Files (x86)/Google/Chrome/Application"); options.addArguments("start-maximized"); options.setExperimentalOption("excludeSwitches",new String[]{"enable-automation"}); options.addArguments("--disable-extensions"); options.addArguments("--disable-infobars"); options.addArguments("--allow-running-insecure