selenium-webdriver

Codeception - Can't connect to Webdriver (Acceptance Test)

江枫思渺然 提交于 2021-02-09 09:20:20
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

Cannot read property 'click' of undefined while using Java Script Executor in Selenium

孤者浪人 提交于 2021-02-09 01:49:50
问题 I am getting an error: Cannot read property 'click' of undefined while trying to click a button using java script executor. I have tried many different approach to click the button using action classes, webdriverwait etc but none seems to work.Java Script is working in console but when i am using in my code i am unable to click the button and getting the mentioned error The html dom looks as below: <div> <a class="button button--new-resource" href="/admin/certificate_types/new"> <img src="

Cannot read property 'click' of undefined while using Java Script Executor in Selenium

心不动则不痛 提交于 2021-02-09 01:47:55
问题 I am getting an error: Cannot read property 'click' of undefined while trying to click a button using java script executor. I have tried many different approach to click the button using action classes, webdriverwait etc but none seems to work.Java Script is working in console but when i am using in my code i am unable to click the button and getting the mentioned error The html dom looks as below: <div> <a class="button button--new-resource" href="/admin/certificate_types/new"> <img src="

Cannot read property 'click' of undefined while using Java Script Executor in Selenium

ぐ巨炮叔叔 提交于 2021-02-09 01:46:49
问题 I am getting an error: Cannot read property 'click' of undefined while trying to click a button using java script executor. I have tried many different approach to click the button using action classes, webdriverwait etc but none seems to work.Java Script is working in console but when i am using in my code i am unable to click the button and getting the mentioned error The html dom looks as below: <div> <a class="button button--new-resource" href="/admin/certificate_types/new"> <img src="

Selenium: how to click on javascript button

非 Y 不嫁゛ 提交于 2021-02-08 23:45:05
问题 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

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

How to simulate Print screen button using selenium webdriver in Java

倖福魔咒の 提交于 2021-02-08 12:18:47
问题 How to simulate Print screen button using selenium web driver in Java Regards, Vignesh 回答1: selenium doesn't support it, only web page shots. However you can use Robot to do it try { String format = "jpg"; String fileName = printScreen." + format; Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); Robot robot = new Robot(); BufferedImage screenFullImage = robot.createScreenCapture(screenRect); ImageIO.write(screenFullImage, format, new File(fileName)); } catch

how to click on the yahoo sign in link using selenium web driver?

倾然丶 夕夏残阳落幕 提交于 2021-02-08 12:00:22
问题 (Sign In) this is the html tag of yahoo sign in. I want to click on the sign in using selenium web driver, and also get the value which is in the title="sign in"? can anyone solve my problem please. 回答1: WebElement el = driver.findElement(By.cssSelector(".social-enabled-txt")); String elementValue = el.getText(); //This one gets the value el.click(); // This one clicks on the signin button on yahoo.com homepage. 来源: https://stackoverflow.com/questions/30481762/how-to-click-on-the-yahoo-sign

Select dropdown in selenium webdriver

旧城冷巷雨未停 提交于 2021-02-08 11:13:01
问题 I can't be able to select values from the dropdown in selenium webdriver. I tried all the ways using name and xpath selectors. Please help. The code is: <span id="cboEmploymentTypeId" class="select" tabindex="0" name="cboEmploymentTypeId" unselectable="on" style="-moz-user-select: none; box-shadow: none;"> 回答1: Try this: @browser.select_list(name:"cboEmploymentTypeId").option[1...n].select 来源: https://stackoverflow.com/questions/28935813/select-dropdown-in-selenium-webdriver

Design issue in Cucumber spring WebDriver quit in @After method

让人想犯罪 __ 提交于 2021-02-08 11:05:30
问题 I have a design issue when I am trying to build a framework using cucumber, selenium and cucumber-spring. My expected behavior is to quit WebdDriver instance for every scenario. But Here is my page objects in src\main\java @Component public class BasePage { WebDriver driver; public BasePage(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); } public WebDriver getDriver() { return this.driver; } } Here is another page object class which extends the Base class.