Edge case testing is a crucial aspect of software quality assurance that focuses on examining the behavior of an application at the extreme boundaries of its functional parameters. These edge cases often consist of scenarios that occur at the outer limits of normal operating conditions, pushing the system to its extremes. Identifying and understanding these…
The post Edge Case Testing: A Comprehensive Guide appeared first on Software Testing Material.
Software Engineering
I am trying to drag an element into another element using Selenium WebDriver but it’s not working. I tried all the solutions which I can find on internet but none of the solutions seems to be working for me.
WebElement sourceelement = driver.findElement(By.cssSelector(“XXX”));
WebElement destelement = driver.findElement(By.cssSelector(“YYY”));
Code1:-
Actions builder = new Actions( _controls.getDriver());
builder.dragAndDrop(sourceelement, destelement);
Code2:-
Actions builder = new Actions(_controls.getDriver());
Action dragAndDrop =
builder.clickAndHold(sourceelement).moveToElement(destelement).release(destelement).build();
Thread.sleep(2000);
dragAndDrop.perform()
Code3:-
Point coordinates1 = sourceelement.getLocation();
Point coordinates2 = destelement.getLocation();
Robot robot = new Robot();
robot.mouseMove(coordinates1.getX(), coordinates1.getY());
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseMove(coordinates2.getX(), coordinates2.getY());
robot.mouseRelease(InputEvent.BUTTON1_MASK);
Thread.sleep(2000);
Code4:-
final String java_script =
“var src=arguments[0],tgt=arguments[1];var dataTransfer={dropEffe” +
“ct:”,effectAllowed:’all’,files:[],items:{},types:[],setData:fun” +
“ction(format,data){this.items[format]=data;this.types.append(for” +
“mat);},getData:function(format){return this.items[format];},clea” +
“rData:function(format){}};var emit=function(event,target){var ev” +
“t=document.createEvent(‘Event’);evt.initEvent(event,true,false);” +
“evt.dataTransfer=dataTransfer;target.dispatchEvent(evt);};emit(‘” +
“dragstart’,src);emit(‘dragenter’,tgt);emit(‘dragover’,tgt);emit(” +
“‘drop’,tgt);emit(‘dragend’,src);”;
((JavascriptExecutor)_controls.getDriver()).executeScript(java_script, sourceelement, destelement);
Thread.sleep(2000);
None of the above code is working for me. All the above runs without any error but drag and drop is not happening in the application. Anyone having any other solution ? Thanks.
Browser :- IE
Description of the class RedisCliWrapper
I have created a class called RedisCliWrapper where I have written many methods which call methods of the class redis.Redis. Substantially I have created a wrapper of the class redis.Redis. The reason of this choice is not important in this question.
The class RedisCliWrapper is written in the module redis_cli_wrapper.py. Below I show the class with only the method get_hgetall_value(), which is one of its many methods:
from redis import Redis
class RedisCliWrapper:
def __init__(self, redis_cli_instance : Redis):
self.__redis_cli_instance : Redis = redis_cli_instance
def get_hgetall_value(self, key):
return self.__redis_cli_instance.hgetall(key)
As the code shows when I create an instance of RedisCliWrapper I have to pass to the __init__() method an instance of the class redis.Redis.
Description of the test class RedisCliWrapperTestCase
To test the class RedisCliWrapper I have created a test module called test_redis_cli_wrapper.py. The content of the module is the following:
import unittest
from unittest import mock
import redis
from redis_cli_wrapper import RedisCliWrapper
class RedisCliWrapperTestCase(unittest.TestCase):
def setUp(self):
self.mock_redis_cli = mock.create_autospec(redis.Redis)
#self.mock_redis_cli = mock.Mock()
self.sut = RedisCliWrapper(self.mock_redis_cli)
def test_something_1(self):
self.mock_redis_cli.hgetall.return_value = {‘f1’: ‘value1’, ‘f2’: ‘value2’}
self.sut.get_hgetall_value(‘key1’)
self.mock_redis_cli.hgetall.assert_called_once_with(‘key1’)
def test_something_2(self):
self.mock_redis_cli.hgetall.return_value = {‘f21’: ‘value21’, ‘f22’: ‘value22’}
self.sut.get_hgetall_value(‘key2’)
self.mock_redis_cli.hgetall.assert_called_once_with(‘key2’)
def test_something_3(self):
self.mock_redis_cli.hgetall.return_value = {‘f1’: ‘value1’, ‘f2’: ‘value2’}
self.assertDictEqual({‘f1’: ‘value1’, ‘f2’: ‘value2’}, self.sut.get_hgetall_value(‘key1’))
if __name__ == ‘__main__’:
unittest.main()
In my real test module there are more than 200 tests, but here it is not important to show all the test methods (the same I have not showed all the methods of the class RedisCliWrapper).
How instantiate the attribute mock_redis_cli
In the previous test code the attribute mock_redis_cli is instantiated by the use the function mock.create_autospec():
self.mock_redis_cli = mock.create_autospec(redis.Redis)
If I execute the 3 tests, I obtain the following output:
> python test_redis_cli_wrapper.py
…
———————————————————————-
Ran 3 tests in 0.495s
OK
which shoes that the 3 tests are execute in 0.495 s (the execution of my real test code takes about 40 seconds).
If I instantiate the attribute mock_redis_cli by the following instruction:
self.mock_redis_cli = mock.Mock()
so without the use of the function mock.create_autospec(redis.Redis), the output of the execution of the 3 tests is the following:
> python test_redis_cli_wrapper.py
…
———————————————————————-
Ran 3 tests in 0.001s
OK
so the 3 tests are executed in only 1 ms (the execution of my real test code with the use of mock.Mock() instead of mock.create_autospec(redis.Redis) takes about 0.130 seconds).
My question
The time execution difference is enormous so in my context it is recommended to use mock.create_autospec(redis.Redis) or I can use the faster mock.Mock() instantiate instruction?
org.openqa.selenium.UnsupportedCommandException: This API is not supported anymore. See https://github.com/appium/appium/issues/15807
Build info: version: ‘4.7.0’, revision: ‘0a5b49d16f’
System info: os.name: ‘Mac OS X’, os.arch: ‘aarch64’, os.version: ‘14.5’, java.version: ‘17.0.11’
Driver info: io.appium.java_client.android.AndroidDriver$ByteBuddy$XSxgr1kt
Command: [be490095-e2e2-400d-807c-052b1607142e, launchApp {}]
Feature testing is an important part of software development life cycle. It helps to ensure that new features work as expected before they are released to users. By testing features, developers can identify and fix any bugs or issues, making the software more reliable and user-friendly. This article will provide a simple overview of what…
The post What is Feature Testing: Advantages, and How To Test A Feature appeared first on Software Testing Material.
Im currently working on a platform that has multi-language options and also the language is defined by IP. So Im trying to build an architecture for testing both scenarios dynamically… The domain is always the same: Example: www.page.com (If you are logged in from Britain the web application is loaded in English, if you are visiting the page from France the page is loaded in French.)
I have an idea to make different abstract classes with error messages for example:
public class ErrorMessagesEN {
public static final String MANDATORY_FIELD = “This field is mandatory…”;
public static final String SOME_OTHER_ERROR_MSG = “Some error message on english”
// etc…..
}
public class ErrorMessagesFR {
public static final String MANDATORY_FIELD = “Error message in French”
public static final String SOME_OTHER_ERROR_MSG = “Some error message on
French”
// etc…..
}
In the test method i provide parameter “EN” or “FR” for example:
homepage.signIn(String location)
So is there any option to make for example:
if (location==”EN”) {
// load the ErrorMessageEN
// etc……
}
The keys for the Strings are the same but the classes are different, so how can I provide different imports of the classes by the location parameter for example? Or are there any better approaches for this situation? Any links or ideas?
Thanks!
PS. If you need more info to help me please ask! 🙂
I’m building a selenium test using a POM, and I have a List of Webelements (companyNames in SelectAccountPage) that keeps throwing a UninitializedPropertyAccessException.
Here’s the Page Object
class SelectAccountPage(driver: WebDriver) {
@FindBy(css = “header h2”)
lateinit var selectAccountTitle: WebElement
@FindBy(css = “div[class*=’company-picker’] h3”)
lateinit var companyNames: List<WebElement>
init {
PageFactory.initElements(driver, this)
}
fun pickCompany(companyToSelect: String) {
for (company in companyNames) {
if (company.text == companyToSelect) {
company.click()
}
}
}
and the test
class SignInTest : TestBase() {
lateinit var signInPage: SignInPage
lateinit var forgotPasswordPage: ForgotPasswordPage
lateinit var selectAccountPage: SelectAccountPage
@BeforeTest
fun initPageObjects() {
signInPage = SignInPage(driver)
forgotPasswordPage = ForgotPasswordPage(driver)
selectAccountPage = SelectAccountPage(driver)
assert = SoftAssert()
}
@Test(priority = 3)
fun validCredentials() {
driver.get(signInPage.url)
signInPage.sendCredentials(Config.getUser(), Config.getPassword())
assert.assertTrue(driver.currentUrl.contains(“app”))
selectAccountPage.pickCompany(“Generic”)
assert.assertAll()
}
I’m not sure what’s going on here because the Webelement on the same page is initialized just fine. Is there something specific that needs to be done when initializing Lists?
Build Verification Testing (BVT) is an important step in software development. It helps ensure that the newest build of the software is stable and functions as expected before moving on to further testing. Often called “smoke testing†or “build acceptance testing,†BVT focuses on checking the essential features of the software quickly. This process helps…
The post Build Verification Testing (BVT Testing) – A Quick Guide to Ensure Quality Software Releases appeared first on Software Testing Material.
In my research so far, I’ve found Jmeter, but Jmeter looks like it’s for testing the services that the app are going to access. I am interested more in testing the system resource boundaries,m like low CPU and memory in the device, as well as longevity tests where it can run the same tasks in an automated fashion for a long period of time.
Robotic Process Automation in Finance – Transforming the Industry How does Implementing RPA in Finance help Overcome these Challenges? Some Key Use Cases of Robotic Process Automation in Finance How to Deploy RPA in Banking & Finance Conclusion When it comes to the potential use cases for Robotic Process Automation (RPA), many things may come … Continue reading “Robotic Process Automation in Finance – What’s the Buzz and Why Should You Care”
The post Robotic Process Automation in Finance – What’s the Buzz and Why Should You Care first appeared on TestingXperts.
I can’t capture with findElement the class, xpath etc. in:
https://economia.estadao.com.br/noticias/geral,por-que-nao-tres-em-uma,70002648617
click on: entre aqui para ler a matéria.
I already tried several ways.
My code is
public static void main(String[] args) {
System.setProperty(“webdriver.gecko.driver”,”C:\ESTADAO\Browsers\geckodriver.exe”);
WebDriver navegador = new FirefoxDriver();
navegador.get(“economia.estadao.com.br/noticias/…);
navegador.manage().window().maximize();
navegador.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
navegador.findElement(By.xpath(“/html/body/div/div/div[2]/div[1]/div[2]/div/a/div[2]”)).click();
}
I am able to record my test cases via Http(S) Test Script Recorder but when I run those test cases, they all are failing.
Before started recording, I was getting ‘No Internet’ message on my browser. But once I clicked on “Start’ to record and refreshed my site,It started recording. After I am done with recording, Site is again not accessible with the same message ‘No Internet’ and failing my run. How can I make my site available again? I am using chrome browser.
Please help.
Thanks in advance!
Pushed the JMeter Selenium Scripts into Azure GIT Repository, created the pipeline and run the pipeline.
Agents added are: JMeter, Command Line, Publish pipeline artifact and publish and download artifacts from Release pipelines.
In the scripts the JSR223 Sampler, counters and Chrome Driver Config are added and after execution of test html file also generated but observed no transactions are happening.
Could anyone please help me?
Use of Generative AI in Healthcare by Different Groups Healthcare Industry’s Biggest Challenges Functions of Generative AI in Healthcare App Development Ethical Considerations of Generative AI Usage in Healthcare Apps How can Tx help with Healthcare App Testing? Summary Patients’ increasing reliance on information sources (like the Internet) and smart healthcare app solutions has long … Continue reading “Transforming Patient Care: The Impact of Generative AI in Healthcare”
The post Transforming Patient Care: The Impact of Generative AI in Healthcare first appeared on TestingXperts.
Hotfixes play a critical role in software testing and maintenance. Think of a hotfix as an urgent repair job done on a live system to quickly fix unexpected problems, like bugs, without needing a system restart. This type of swift fix is essential to ensure users do not face long disruptions and that the software…
The post What is a Hotfix: Definition, Benefits, Challenges, and How is Hotfix Tested appeared first on Software Testing Material.
Although web and mobile applications are more widely used now, desktop applications still play an integral role for many organizations. So the need to automate desktop applications for testing purposes is still prevalent and we have many test automation tools in the market as well. Being an expert desktop application automation testing company, we have
The post Best Desktop Application Automation Testing Tools in 2024 appeared first on Codoid.
On selecting the radio button how to get the text of the selected radio button where the text is in the next column
I randomly select the radio button and then i need to Store the selected Radio button’s Vessel Name
Below is the Code:
public String checkselectedplanningVesselname()
{
String rowOne = “”;
List<WebElement> radiobuttonoptions =driver.findElements(By.xpath(“//table[contains(@class,’mat-table cdk-table’)]//following::mat-radio-button[contains(@id,’mat-radio’)]”));
for (int i=0;i<radiobuttonoptions.size();i++)
if(driver.findElement(By.xpath(“//table[contains(@class,’mat-table cdk-table’)]//following::mat-radio-button[contains(@id,’mat-radio’)]”)).isSelected())
{
rowOne = radiobuttonoptions.get(i).getText(); =
System.out.println(“Print the Selected VesselName:”+ rowOne);
break;
}
return rowOne;
}
Below is the HTML of the table :
HTML:
<tbody role=”rowgroup”>
<tr _ngcontent-epp-c110=”” role=”row” mat-row=”” class=”mat-row cdk-row ng-star-inserted”>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-radio mat-column-radio ng-star-inserted”>
<span _ngcontent-epp-c110=”” class=”ng-star-inserted”>
<!—->
<mat-radio-button _ngcontent-epp-c110=”” color=”primary” class=”mat-radio-button mat-primary ng-star-inserted” id=”mat-radio-1″><label class=”mat-radio-label” for=”mat-radio-1-input”><span class=”mat-radio-container”><span class=”mat-radio-outer-circle”></span><span class=”mat-radio-inner-circle”></span><input type=”radio” class=”mat-radio-input cdk-visually-hidden” id=”mat-radio-1-input” tabindex=”0″ value=”8252″><span mat-ripple=”” class=”mat-ripple mat-radio-ripple mat-focus-indicator”><span class=”mat-ripple-element mat-radio-persistent-ripple”></span></span></span><span class=”mat-radio-label-content”><span style=”display: none;”> </span></span></label></mat-radio-button>
<!—-><!—->
</span>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”></span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vesselName mat-column-vesselName ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>TESTVESSELTECHM1</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vettingStatus mat-column-vettingStatus ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>GREEN</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-imoNumber mat-column-imoNumber ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>00121</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vouageId mat-column-vouageId ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>TBD</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-lastValidityDate mat-column-lastValidityDate ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>2035-10-05</span><!—->
</td>
<!—->
</tr>
<tr _ngcontent-epp-c110=”” role=”row” mat-row=”” class=”mat-row cdk-row ng-star-inserted”>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-radio mat-column-radio ng-star-inserted”>
<span _ngcontent-epp-c110=”” class=”ng-star-inserted”>
<!—->
<mat-radio-button _ngcontent-epp-c110=”” color=”primary” class=”mat-radio-button mat-primary ng-star-inserted mat-radio-checked” id=”mat-radio-2″><label class=”mat-radio-label” for=”mat-radio-2-input”><span class=”mat-radio-container”><span class=”mat-radio-outer-circle”></span><span class=”mat-radio-inner-circle”></span><input type=”radio” class=”mat-radio-input cdk-visually-hidden” id=”mat-radio-2-input” tabindex=”0″ value=”8253″><span mat-ripple=”” class=”mat-ripple mat-radio-ripple mat-focus-indicator”><span class=”mat-ripple-element mat-radio-persistent-ripple”></span></span></span><span class=”mat-radio-label-content”><span style=”display: none;”> </span></span></label></mat-radio-button>
<!—-><!—->
</span>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”></span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vesselName mat-column-vesselName ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>TESTVESSELTECHM2</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vettingStatus mat-column-vettingStatus ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>GREEN</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-imoNumber mat-column-imoNumber ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>00122</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vouageId mat-column-vouageId ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>TBD</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-lastValidityDate mat-column-lastValidityDate ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>2035-10-15</span><!—->
</td>
<!—->
</tr>
<tr _ngcontent-epp-c110=”” role=”row” mat-row=”” class=”mat-row cdk-row ng-star-inserted”>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-radio mat-column-radio ng-star-inserted”>
<span _ngcontent-epp-c110=”” class=”ng-star-inserted”>
<!—->
<mat-radio-button _ngcontent-epp-c110=”” color=”primary” class=”mat-radio-button mat-primary ng-star-inserted” id=”mat-radio-3″><label class=”mat-radio-label” for=”mat-radio-3-input”><span class=”mat-radio-container”><span class=”mat-radio-outer-circle”></span><span class=”mat-radio-inner-circle”></span><input type=”radio” class=”mat-radio-input cdk-visually-hidden” id=”mat-radio-3-input” tabindex=”0″ value=”8301″><span mat-ripple=”” class=”mat-ripple mat-radio-ripple mat-focus-indicator”><span class=”mat-ripple-element mat-radio-persistent-ripple”></span></span></span><span class=”mat-radio-label-content”><span style=”display: none;”> </span></span></label></mat-radio-button>
<!—-><!—->
</span>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”></span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vesselName mat-column-vesselName ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>TESTVESSELTECHM1</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vettingStatus mat-column-vettingStatus ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>GREEN</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-imoNumber mat-column-imoNumber ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>00121</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-vouageId mat-column-vouageId ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>TBD</span><!—->
</td>
<td _ngcontent-epp-c110=”” role=”gridcell” mat-cell=”” class=”mat-cell cdk-cell cdk-column-lastValidityDate mat-column-lastValidityDate ng-star-inserted”>
<!—-><span _ngcontent-epp-c110=”” class=”ng-star-inserted”>2035-10-25</span><!—->
</td>
<!—->
</tr>
<!—-><!—->
</tbody>
When running jmeter script for JDBC connection, I’m getting an error as mentioned below.
How can I resolve it?
Jmeter bamboo log – SQLException: Cannot create PoolableConnectionFactory
Error while processing sampler: ‘bzm – Parallel Controller’.
java.lang.reflect.InaccessibleObjectException: Unable to make field java.lang.ThreadLocal this error facing while using bzm parallel controller in jmeter latest version
I’m looking into the BlazeMeter Advanced JMeter tutorial
(https://academy.blazemeter.com/courses/advanced-jmeter/)
In lesson 7: Pacing, he uses some Groovy code to delay the dummy sampler, which is as follows:
long iterationCount = ${__counter(FALSE,)}
if (iterationCount < 500) {
log.info(“Iteration Count: ${iterationCount}”)
}
else
{
long delayVal = Long.parseLong(props.get(“delayProp”));
if (delayVal < 400) {
delayVal = delayVal + 1
props.put(“delayProp”, String.valueOf(delayVal))
log.info(“Thread: ${__threadNum} Iteration: ${__iterationNum} Delay value: ${__P(delayProp,)}”)
}
}
Unfortunately he doesn’t show how to integrate this code in the JSR223 PostProcessor with the dummy sampler. So my sampler is not delaying when the iteration count goes over 500.
Any idea on how I can apply this code for a delay in the sampler?
In the project he has following elements:
User Defined Variables
Arrival Threads Group with 3 Dummy Samplers
Under the 3rd dummy sampler, there is a JSR223 PostProcessor with the
code
Response Times Over Time listener
Active Threads Over Time listener
Transactions per Second listener