selenium

Selenium not able to click on Get Data button on using Python

时光怂恿深爱的人放手 提交于 2021-01-28 06:22:37
问题 I am scraping data from this website . The element is below and geckodriver <img class="getdata-button" style="float:right;" src="/common/images/btn-get-data.gif" id="get" onclick="document.getElementById('submitMe').click()"> but can't get selenium to click it tried even xpath, id but not luck is there any fix or work around to get it done? 回答1: To click on the element Get Data you can use either of the following Locator Strategies: Using css_selector : driver.find_element_by_css_selector(

Run tests in parallel using Cucumber with Java Selenium with Gradle

痴心易碎 提交于 2021-01-28 06:20:31
问题 I'm using Cucumber with Gradle and would like to run Cucumber features in parallel but can't figure out how. My cucumber executor looks like this: task cucumber() { dependsOn assemble, compileTestJava doLast { javaexec { main = "cucumber.api.cli.Main" classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output args = ['--plugin', 'pretty', '--plugin', 'json:build/reports/cucumber-report.json', '--plugin', 'html:build/reports/cucumber-report.html', '--glue',

Java - drag and drop not working on selenium 3.8

走远了吗. 提交于 2021-01-28 06:18:27
问题 drag and drop not working on selenium 3.8. Here is the JS code for the element This is what I have tried. But it is only selecting the element. Hold and drop is not happening. WebElement source = driver.findElement(By.xpath("//tbody[@class ='lt-body']//tr[@data-test-id='table-row-id-20']//td[contains(@id,'ember')]//div[contains(@id,'ember')]//*[name()='svg']//*[name()='ellipse']")); WebElement destination = driver.findElement(By.xpath("//tbody[@class ='lt-body']//tr[@data-test-id='table-row

chrome doesn't maximize when running selenium testNG from jenkins

坚强是说给别人听的谎言 提交于 2021-01-28 06:09:43
问题 I am facing a problem with running selenium testNG test from jenkins , the problem is that i am doing a login to my application and checking some element visibility , when i run the test from the batch file directly i got a success because i'm setting my google chrome driver to maximize using: driver.manage().window().maximize(); but if the browser is minimized some elements are not visible (front-end requirements) , so when i run the test from jenkins the test failed because i think that the

Getting “Nosuch element Exception” in Selenium Though XPATH is correct. Not sure is this due to Shadow DOM. Please confirm

人走茶凉 提交于 2021-01-28 06:04:51
问题 I am trying to automate Salesforce application Using Selenium and getting NoSuchelementException though XPATH is correct and valid for particular object. When i have searched the issue, it might be reason for Shadow DOM. For EX: So XAPTH i have written like, driver.findElement(By.xpath("//input[@name='Name']")).sendKeys("Jams"); or driver.findElement(By.xpath("//input[@id='input-299']")).sendKeys("Jams"); This XPATH is highlighting in Console as well. But while automating it throws

Error NoClassDefFoundError while running Junit test

坚强是说给别人听的谎言 提交于 2021-01-28 06:01:17
问题 When I run this script to automate : package testRunners; import org.junit.runner.RunWith; import io.cucumber.junit.Cucumber; import io.cucumber.junit.CucumberOptions; @RunWith(Cucumber.class) @CucumberOptions(features="resources/features", glue="") public class TestRunner_GoogleHomepage { } I use : cucumber-core-5.7.0.jar cucumber-java-5.7.0.jar cucumber-junit-5.7.0.jar cucumber-jvm-deps-1.0.6.jar gherkin-8.2.1.jar junit-4.12.jar mockito-all-1.10.19.jar I obtain this error result in Java

Getting “Nosuch element Exception” in Selenium Though XPATH is correct. Not sure is this due to Shadow DOM. Please confirm

时间秒杀一切 提交于 2021-01-28 05:55:00
问题 I am trying to automate Salesforce application Using Selenium and getting NoSuchelementException though XPATH is correct and valid for particular object. When i have searched the issue, it might be reason for Shadow DOM. For EX: So XAPTH i have written like, driver.findElement(By.xpath("//input[@name='Name']")).sendKeys("Jams"); or driver.findElement(By.xpath("//input[@id='input-299']")).sendKeys("Jams"); This XPATH is highlighting in Console as well. But while automating it throws

Multiple conditions in BeautifulSoup: Text=True & IMG Alt=True

萝らか妹 提交于 2021-01-28 05:49:30
问题 is there a way to use multiple conditions in BeautifulSoup? These are the two conditions I like to use together: Get text: soup.find_all(text=True) Get img alt: soup.find_all('img', title=True): I know I can do it separately but I would like to get it together to keep the flow of the HTML. The reason I'm doing this is because only BeautifulSoup extract the hidden text by css: Display None. When you use driver.find_element_by_tag_name('body').text you get the img alt att, but unfortunately not

How to click on open application alert using Selenium

末鹿安然 提交于 2021-01-28 05:30:37
问题 I am trying to click on open application alert using Selenium, and I am getting this error NoAlertPresentException: Message: no such alert So basically I am trying to open zoom application from the browser And here is my code: from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException driver = webdriver.Chrome(executable_path='chromedriver

Error while Installing TestNG Eclipse Plugin 6.14.3 Version

☆樱花仙子☆ 提交于 2021-01-28 05:30:35
问题 I am getting the following error while installing TestNG plugin( 6.14.3) in Eclipse. Missing requirement: TestNG Eclipse Support 6.14.3.201902250526 (org.testng.eclipse 6.14.3.201902250526) requires 'bundle org.eclipse.jdt.launching 3.10.0' but it could not be found Cannot satisfy dependency: From: TestNG 6.14.3.201902250526 (org.testng.eclipse.feature.group 6.14.3.201902250526) To: org.testng.eclipse [6.14.3.201902250526] I am using Eclipse Oxygen- March Edition. Could anyone please help me