Newest testcase Questions

Q&A for professional and enthusiast programmers

Create a test case for curl httprequest

PHPUnit has methods to test databases virtually, but how can I test an HTTP service like curl? My class method gets a URL and requests parameters to send to server. It receives the answer as json and ...

I can't able to integrate the testlink (Test Management Tool) with JIRA using REST Interface

I am not able to integrate the TestLink with JIRA using REST Interface, While connecting, It displays the error message as "Connection is KO, Check configuration". PFAenter image description here

Results are not reflected for a test case when it is linked to a new testsuite in mtm

I have TestCase tc under TestSuite A. Now I have linked the tc to a new testsuite B. TestCase tc under 'A' was run many a times and has good amount test results hirstory. But when I view the same ...

Add scala test-case to jar file in maven project

I want to include scala test case to the jar file. I have maven project. I have used following : <assembly> <id></id> <formats> <format></format> </formats&...

How to write the test case in Jasmine in Angular2 for redirect URL?

SecurityService.prototype.Feedback = function () { window.open('https://www.google.com/', '_blank'); I need to write the test case for above code in Jasmine in Angular 2.

Why could this code possibly be failing a test case?

I began a fairly simple Google foobar exercise and have 24 hours left to finish it. So I literally just started coding python while learning it and I got 4/5 of their test cases to pass. I've been ...

Cannot find context in class which extends TestCase

I am writing test cases for android app classes. But I am unable to find a way to get context of this class. Below is my test case class. public class SplashScreenActivityTest extends TestCase { ...

test case not covering in cobertura

public class MyUtil { public static Properties loadProperties() throws Exception { Properties prop = new Properties(); InputStream inputStream = MyUtil.class.getClassLoader()....

Test Case for Listview Item in Fragment

I have an Activity.java which includes some tabs. Each tab represents different Fragments. One tab namely Menu has a listview where the items are being fetched from API call. Now, how can I write ...

What's wrong when running process under testcase and quartz job

all.I have a problem . It is ok that i run the code on main method. new Thread(()-> { try { IOUtil.executeSystemCommand("ipconfig", new ProcessCallback() { @...

Test Scenario for automation test developers

"Suppose there was a transaction that had been done in Company , the transaction id should be available on the screen alongside with the address of shipment, date of order, seller’s name, and delivery ...

Is there a way to reduce the size of a preprocessed source of a compiler bug test case using Clang?

I ran into an issue with the Intel compiler and wondered if there was a way to automatically reduce the size of the preprocessed source. It seems a lot of standard headers (of which quite some ...

Android Studio: Create JUnit test case with template?

It is possible to create a JUnit test class in Android Studio as it is known from Eclipse? That means creating a class with some defined values like @Before, @After, and so on. What I mean is this...

Can you “skip” a code block in phpunit?

I was assigned on an old project and currently doing the test cases. I have an error on a certain code block that saves the data to excel. However, the method outputs a header, and thus the phpunit ...

Unable to cover or conditioned line in test case

I am one function where I am returning values like this... GetData(){ let parsedData= JSON.parse(data.data.json); return { x: parsedData.x|| [], y: parsedData.y|| [] ...

TFS - linking Run ID to Test ID?

TFS web: I assigned all testers to test a specific suite / test cases. I'm looking for a possibility to create a statistic / query to associate the run IDs to their test case ID. Would this be ...

How can I know that TestNG framework is suitable to perform test case prioritization in regression testing?

I have a requirement to know that, whether TestNG framework is suitable for test case prioritization in regression testing to increase the fault rate detection or not? Which also enhance the ...

Test case for destructuring in clojure for database connectivity

I started working on clojure a week back and i am not able to write a test case for the below code for destructuring of maps using default values: (defn connect-db [{:keys [host port db-name username ...

Groovy Spock Test case - inner method invocation

ApplicationController.groovy: public class ApplicationController { @Autowired ApplicationService applicationService public void executeMethodA(Map requestBody, HttpServletRequest ...

Cannot read property 'checked' of null in TestCase

In my JS I have below mentioned code in Initialize function. initialize: function () { if (!$("#VisitorIsSelected").is(':checked')) { $("#VisitorIsSelected").attr('...

How to write test code for Web API in Visual Studio?

I'm a bit new to test project. I currently have a web api project which contains Get, Put, Post and Delete methods. When comes to writing test cases, I'm confused. Should I write test code to test the ...

Is there any way to add logic to my recorded Selenium test case?

I downloaded the latest Selenium add-on for Firefox and I recorded the following a couple of clicks through a web site. When I saved the test case, it saved like so … <?xml version="1.0" encoding=...

Where to import libraries in unit tests ? Python

I have to write a test file like this: import unittest from mylibrary import some_crazy_func class TestSomething(unittest.TestCase): def test_some_crazy_func_that_needs_io_open(self): # ...

Increase Code Coverage on Salesforce Standard Developer Test Case

I need to increase code coverage on my test case. Right now, I am around 50%. I know that my extension is Account, but I somehow need to include Task info and Account.ParentId != Null and Task....

testcase not working properly. Issue setting two numbers equal to each other

I'm working on a test case and I'm having trouble. I'm having a hard time with getting my test cases to work. Here is the code: public class Appointment extends Actor { int hour; ...

JUnit Testing with User Inputs and Loops

I have been provided a piece of code and need to write JUnit Test Case for it. I am stuck regarding the loops and user input. import java.util.Scanner; import java.text.*; public class ...

Analyzing Graham Scan Algorithm of Convex Hull

I have made a code to implement Graham Scan algorithm of convex hull. I have tested the program by generating some test cases. In all cases it gives accurate result. But My question is, is it possible ...

What will be the RSpec test case for devise invitation controllers edit and update method

I am not able to go in my invitation controller edit method, I have tried everything but not able to go in edit method. Here is my edit method test case: describe "GET :edit invitation" do it '...

React-native test cases fail

I'm trying to write some test cases of a simple react-native app, but my test case always fails with an error which apparently cannot find UIManager.createView Component class LiveTab extends ...

JUnit 4 Test Case [closed]

I need help on creating JUnit 4 Test Case for this code. public static int computeValue(int x, int y, int z) { int value = 0; if (x == y) value = x + 1; else if ((x > y) &&...

how to write Test Cases for Playframework for data taking from DB(H2) by using key value(Map)

public static Map<String,Double> getSettings(){ Map<String,Double> setData= new TreeMap<>(); Logger.info("Befor List*********"); List<SystemSetting> setDataList=...

TFS C# Update Steps in TestCases

Im trying to update the field steps as with other fields testCase.Fields["field"].Value = "value"; but is still empty after the change. How can I modify the steps in a Test Case?

How to fix the code to test the case by JUnit and POI?

Why I can't have succeed to test this case? @Test public void test_Should_be_0() throws Exception { HSSFCell cell = new HSSFWorkbook().createSheet().createRow(0).createCell(0); cell....

Rounding float numbers within a dictionary

I am trying out a challenge at codewars.com, but I cannot figure out why my code cannot pass the test cases.I am supposed to round of any float numbers to 2 decimal points within a dictionary. I have ...

How to write unit test case for BadRequest?

I want to write Unit test cases for following code HomeController.cs [HttpPost] [ActionName("CreateDemo")] public async Task<IHttpActionResult> CreateDemo([FromBody] MyRequest ...

How to do bulk update of fields for test suite in test link?

There is a test suite already created with test summary and test steps in test link. I have to update few fields in each test case. How can i update in bulk instead of doing it one by one by clicking ...

Racket test-suite print test-case failure messages

I have the following example of test code: ;; UNIT TESTS (define (check-equal?-with-output a b failure-msg) (display "checking for equality:") (newline) (display a) (newline) (display b) (...

Junit Testsuite count failed testcases

I am using JUnit4 for running test suites with several test classes. And now i want to get the number of failed testcases in each test classe. How can i get the total number of failed testcases ...

Java Rally REST API: How to create new test case

I have been able to successfully create test RESULTS through the Rally APIs, but now I would like to create a test case if one is not already present in Rally. I am receiving an error from Rally that ...

TFS web - Test case invitation via email contains wrong link

I have a TFS 2015 with a couple of projects/teams created. We are doing manual tests and I want to send invitations os these manuel tests/suites to the testers. Exemples: - project a / team 1 - ...

Codeigniter PHPUnit Exception Testcase

How to write testcase for PHPUnit query Exception. Activerecord in codeigniter is not throwing exception. Codeigniter PHPUnit Codecoverage for query Exception

First automated authentication test using Selenium Webdriver in Eclipse

I'm running a my first automated test using selenium webdriver in eclipse on a demo static site. The main purpose of the test is to show that a transaction is confirmed in my log file, e.g. should ...

Django Test mocked ImageField prevent upload or clean after tests

I am working on a TestCase for my project, involving some Image and FileFields. Some objects are loaded with fixtures, some objects are created during the tests. I Mocked my image with a ...

Execute load test on TestSuite in SoapUI

I am using soapUI 4.6.4 version and had some test cases written which i clubbed into a TestSuite. Now i wanted to run loadtest on TestSuite itself i.e all the test cases under Testsuite should be ...

Sonar cube properties for source code from different repository

I have 3 repositories A, B and C. Repository A and B contains source code and they are interrelated and they together forms an application. C contains the test cases for A&B. The unit testcases ...

In what test cases could this fail to give the right output and what are potential solutions?

I need to take a list of integers and multiply its elements such that I get the greatest number possible. This number, I need to output as a string. Example: (int list) givenList = [2, 0, 2, 2, 0] ...

What is the worst-case for gift-wapping algorithm (Jarvis’s Algorithm) to compute convex hull?

I have made a program to implement the Gift Wrapping algorithm of finding convex hull. Is there any way to generate a point set that serves as the worst case for this algorithm? How will I generate ...

How do I clone or copy an existing test case in a suite in VSTS?

Reading up on test different configuration article from Visual Studio. In the example, they were able to create multiple of the same test cases (same ID) and assign different configurations to them. ...

ApplicationTestCase hidden test fails

Hi I have a ApplicationTestCase with 4 test functions. The results for all the 4 tests is "Passed" when running in android studio. There is one test that is NOT exist in my java file which called:"...

SOAPUI JDBC MS SQL query is not working (TestSuite)

I'm using SOAPUI to test a webservice I developped. I'm actually trying to configure a TestSuite with a JDBC call to a MS SQL database. I succeeded in adding the jdbc jar files for MSSQL. The ...
Translating... 0%