testing

Selenium FluentWait and element not visible exception

醉酒当歌 提交于 2020-01-06 17:59:34
问题 I'm trying to use FluentWait instead of sleep and this is my first practice. First of all and most importantly am I doing it right at all? Secondly I got through two elements so I thought it kind of works (PaymentMethod button and CheckOut button). Before I implemented FluentWait it wouldn't find them. And finally it won't find the third(backToDesktop button) element. Keeps throwing Element not visible, although I added the wait.ignore(ElementNotVisibleExcecption.class). FluentWait<WebDriver>

Codeception - closed popup breaks selemium test

99封情书 提交于 2020-01-06 15:18:56
问题 I'm testing a simple flow using Codeception with Selenium/FacebookWebdriver where a popup window gets closed at the end - causing entire test to break. The code is complete (the test will run) and will reproduce the error. I'm really desperate here, any suggestions will be very much appreciated. These are the errors I get: Codeception error message: [Facebook\WebDriver\Exception\NoSuchWindowException] Window not found. The browser window may have been closed. Selenium server output message:

Selenium : wait until attribute value changed

与世无争的帅哥 提交于 2020-01-06 10:21:59
问题 I have image in webpage whose src is changed after some time there can be two possible value after src is changed(time can vary) img_src_success or img_src_failed I have added below code to wait until src is changed but its not working and giving error. WebDriverWait wait = new WebDriverWait(driver, 120); wait.until(ExpectedConditions.attributeToBe(image_src, "src",img_src_success ); where image_src = WebElement src = attribute img_src_success = String value "/src/image/success.png" img_src

Testing custom constraints in Grails App

风格不统一 提交于 2020-01-06 08:33:32
问题 I have the following as my unit test: void testCreateDealer() { mockForConstraintsTests(Dealer) def _dealer= new Dealer( dealerName:"ABC", Email:"abc-motors@global.com", HeadOffice:"", isBranch:false) assertFalse _dealer.validate() } But when I run the test I get the following error: No signature of method: static com.myCompany.Dealer.findByDealerNameIlike() is applicable for argument types: (java.lang.String) values: [ABC] I use some custom constraints in my domain class. How Can I test this

Maven command to run activemq before intergation tests

青春壹個敷衍的年華 提交于 2020-01-06 07:27:21
问题 I need to run ActiveMQ in my maven clean install, so that it starts up activemq and then runs my tests. I have included the plugin in pom.xml and added the mq config file for configuring mq details. It runs successfully and all test pass when I run activeMq on one console and run maven clean install on others (2 separate commands on 2 separate consoles). But is there a way I can run activemq and clean install both with 1 command on the same console? Basically I wish that when I do mvn clean

What is this DalekJS error when I try to run a test via PhantomJS?

和自甴很熟 提交于 2020-01-06 07:26:13
问题 Every time I try to run a test using PhantomJS, Dalek gives me this error. However using GoogleChrome the test runs properly. Running tests /Users/user/node_modules/dalekjs/node_modules/dalek-browser-phantomjs/index.js:273 this.spawned.kill('SIGTERM'); ^ TypeError: Cannot read property 'kill' of null at Object.PhantomJSDriver.kill (/Users/user/node_modules/dalekjs/node_modules/dalek-browser-phantomjs/index.js:273:17) at EventEmitter.emit (/Users/user/node_modules/dalekjs/node_modules

Allowing Untrusted SSL Certificates with Opera browser. Selenium testing (Java)

眉间皱痕 提交于 2020-01-06 07:26:13
问题 How can I allow by Selenium WebDriver to accept untrusted certificate on Opera browser ? I try to use this code. No positive results DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); WebDriver driver = new OperaDriver(capabilities); 回答1: Make a custom profile for your opera browser and then set the capability DesiredCapabilities capabilities = DesiredCapabilities.opera(); capabilities.setCapability("opera.profile",

Allowing Untrusted SSL Certificates with Opera browser. Selenium testing (Java)

血红的双手。 提交于 2020-01-06 07:26:07
问题 How can I allow by Selenium WebDriver to accept untrusted certificate on Opera browser ? I try to use this code. No positive results DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); WebDriver driver = new OperaDriver(capabilities); 回答1: Make a custom profile for your opera browser and then set the capability DesiredCapabilities capabilities = DesiredCapabilities.opera(); capabilities.setCapability("opera.profile",

How to disable specific tests for mvn package command?

六眼飞鱼酱① 提交于 2020-01-06 07:09:43
问题 I have integration tests in the package: my.campaign.ololo.controller.external I want to not run that tests during mvn clean package So I wrote following in my pom.xml <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.21.0</version> <configuration> <excludes> <exclude>my.campaign.ololo.controller.external</exclude> </excludes> </configuration> <

How to disable specific tests for mvn package command?

混江龙づ霸主 提交于 2020-01-06 07:09:34
问题 I have integration tests in the package: my.campaign.ololo.controller.external I want to not run that tests during mvn clean package So I wrote following in my pom.xml <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.21.0</version> <configuration> <excludes> <exclude>my.campaign.ololo.controller.external</exclude> </excludes> </configuration> <