selenium-webdriver

Python selenium enable logging with Firefox webdriver

柔情痞子 提交于 2021-01-29 09:30:22
问题 There seems to be a problem with my implementation but I'm not sure what the problem might be. It would be really helpful if I could check the log files (as mentioned in the exception): WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details. but the process doesn't write anything to the file I designate as the log file. from selenium import webdriver from selenium.webdriver

How to add multiple feature files to Cucumber Runner Class [duplicate]

ⅰ亾dé卋堺 提交于 2021-01-29 09:25:13
问题 This question already has answers here : How to order feature files in Cucumber test suite? (4 answers) Closed 12 months ago . I have 3 separate feature files and one CucumberRunnerClass . As per the sequence need to execute those are listed below: Feature files : Login.feature , NavigateCusMngt.feature , AddCustomer.feature However, when executing it goes to first execute the AddCustomer.feature, then Login.feature and finally NavigateCusMngt.feature. Therefore, I observed AddCustomer

Printing only one element from webelement list in excel

和自甴很熟 提交于 2021-01-29 09:07:16
问题 My code is to print a list of title in to excel using webelement list, but it is only printing one that is last data in to excel. please help. driver.get("http://www.speakingcs.com/"); Sheet sh; List<WebElement> postTitles = driver.findElements(By.className("entry-header")); for (WebElement eachTitle:postTitles) { System.out.println(eachTitle.getText()); File object = new File("D:/selenium/data.xlsx"); FileInputStream fis=new FileInputStream(object); wb=WorkbookFactory.create(fis); sh=wb

Selenium grid launching remote IE browser as run as administrator

你离开我真会死。 提交于 2021-01-29 09:05:19
问题 I have a selenium grid setup and from client machine need to run the grid and it is hitting an URL in remote machine in IE.IE is getting launched in remote machine.The code is in C#. below is the code I want selenium to launch IE as "Run as Administrator" mode. Can some one help me with this ? InternetExplorerOptions options = new InternetExplorerOptions(); options.IntroduceInstabilityByIgnoringProtectedModeSettings = true; options.EnableNativeEvents = true; options.ForceShellWindowsApi =

Close browser popup in Selenium Python

佐手、 提交于 2021-01-29 08:51:17
问题 I am scraping a page using Selenium, Python. On opening the page one Popup appears. I want to close this popup anyway. I tried as below: url = https://shopping.rochebros.com/shop/categories/37 browser = webdriver.Chrome(executable_path=chromedriver, options=options) browser.get(url) browser.find_element_by_xpath("//button[@class='click' and @id='shopping-selector-parent-process-modal-close-click']").click() I tried a couple of similar posts here but nothing is working with me. below the error

What is the significance of the attribute xpath=“1” while constructing locators for Selenium tests

不羁的心 提交于 2021-01-29 08:46:00
问题 Recently I stumbled on an element with an attribute xpath="1" within an angular based application. HTML: I'm unable to find any details about this attribute and it's possible impact and usage within a xpath/cssSelector for the Selenium based tests. Can anyone help me out in any directions please? 回答1: That attribute (xpath="1") is placed there by a browser extension named CHROPATH. It is provided by a feature they call Dynamic Attribute Support . Scolling down the page one will find a text

How to scroll to the end of a page slowly using selenium so that i can get dynamically loaded content

心已入冬 提交于 2021-01-29 08:45:07
问题 On a personal project am working on am in a situation where i need to scrape names of items from a dynamic site using selenium. In order to get all the data you need to scroll to the bottom. However it gets trickier if you scroll to the bottom to quickly you only get names of items at the bottom. It doesn't matter how long you wait you still get the items on scope. So i figured i could scroll to the bottom slowly however it doesn't seem to work. Here is my demo code to illustrate the problem

Selenium-Chromedriver test execution leaves scoped_dir* temp files which makes test execution on an internal website to return 500 error

天涯浪子 提交于 2021-01-29 08:07:16
问题 We have Selenium-C# automation tests running an internal web application that requires an Outh-2 Bearer token. When I run the tests, set of temp files named scope_dir are created. These files get deleted automatically for some tests. But at some time during the test execution, they just remain without being deleted. After, this point, I receive a 500 error response. I have tried the following: Chromedriver not deleting scoped* dir in temp folder after test is complete https://bugs.chromium

Unable to perform parallel execution on safari on mac using selenium

北战南征 提交于 2021-01-29 08:00:34
问题 I have around 1600 java TCs written using selenium. While executing test scripts in parallel (say thread count = 5), I am able to trigger 5 safari webdrivers and scripts are executing parallel. But, when the 6th (threadcount +1) script gets invoked, it is throwing below exception: Could not create a session: The Safari instance is already paired with another WebDriver session. I am quitting and closing the webdriver session after each test case. The same piece of code is working fine for

java.net.UnknownHostException Can't Solve in selenium

寵の児 提交于 2021-01-29 07:48:29
问题 Till Yesterday i was using Webdriver Manager it was working sucessfully. but today it is Throwing some UnknownHostException My Dependinces : <dependency> <groupId>io.github.bonigarcia</groupId> <artifactId>webdrivermanager</artifactId> <version>3.0.0</version> <scope>test</scope> </dependency> This is the way i used to open the browser : WebDriverManager.chromedriver().setup(); driver = new ChromeDriver(); I can't find a Perfect Solution but am getting some solution which is not clear can you