Libraries & Frameworks

I wanted to know, how I can use following waits in program at which situations?

driver.manage.timeouts.implicit_wait = 20
driver.manage.timeouts.script_timeout = 20
driver.manage.timeouts.page_load = 20

My program error is:
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.52.0/lib/selenium/webdriver/common/wait.rb:76:in `until’: timed out after 10 seconds (Unable to locate element: {“method”:”xpath”,”selector”:”.//*[@id=’calendar’]//*[contains(@class, ‘fc-slot4′)]/td/div”}) (Selenium::WebDriver::Error::TimeOutError)
from anonymouspatient.rb:61:in `<main>’

I can locate this element using IRB commands but can’t find an element in selenium Webdriver using Ruby.

I have recently taken over Test Suite creation for my team and I have encountered a rather annoying and time-consuming issue.
Scenario: Let’s say we have 5 Test Suites (folders) and each one needs to have 2 Test Result Charts:

Outcome of Test
Who ran the Test

Currently, I have to go into each Test Suite and add the same exact two Charts every time.
Is there a way that I can just select X Suites and add the Charts en-masse?

Cannot make it work, need help, I don’t know how to automate KendoUI drop-down with Selenium using C#.
Sendkeys doesn’t work for KendoUI.
Here is my HTML:
<div style=”background-color: #e6e6e6; padding: 10px 10px; margin-bottom: 10px;”>
<div class=”row”>
<div class=”col-md-4″>
<div class=”form-group”>
<input class=”k-input form-control” id=”searchColonies” placeholder=”Colony Name” data-bind=”value: searchParameter” type=”text”>
</div>
</div>
<div class=”col-md-4″>
<span style=”width: 100%;” title=”” class=”k-widget k-dropdown k-header” unselectable=”on” role=”listbox” aria-haspopup=”true” aria-expanded=”false” tabindex=”0″ aria-owns=”” aria-disabled=”false” aria-busy=”false” aria-activedescendant=”549cac5d-6e77-4c5b-b528-cc6321984d37″>
<span unselectable=”on” class=”k-dropdown-wrap k-state-default”>
<span unselectable=”on” class=”k-input”>- All Statuses -</span>
<span unselectable=”on” class=”k-select” aria-label=”select”>
<span class=”k-icon k-i-arrow-60-down”></span>
</span>
</span>
<input data-role=”dropdownlist” data-value-primitive=”true” data-text-field=”Status” data-value-field=”StatusID” data-option-label=”- All Statuses -” data-bind=”value: selectedStatus, source: statuses” style=”width: 100%; display: none;”></span>
</div>
</div>
<div class=”row”>
<div class=”col-md-4″>
<span style=”width: 100%;” class=”k-widget k-combobox k-header k-combobox-clearable”>
<span tabindex=”-1″ unselectable=”on” class=”k-dropdown-wrap k-state-default”>
<input class=”k-input” autocomplete=”off” style=”” title=”” role=”combobox” aria-expanded=”false” placeholder=”- All Organizations -” tabindex=”0″ aria-disabled=”false” aria-autocomplete=”list” aria-owns=”” aria-busy=”false” aria-activedescendant=”5e10bcaf-d176-4665-821b-8e94d8ce1be8″ type=”text”>
<span unselectable=”on” class=”k-icon k-clear-value k-i-close k-hidden” title=”clear” role=”button” tabindex=”-1″></span>
<span unselectable=”on” class=”k-select” aria-label=”select” role=”button” tabindex=”-1″>
<span class=”k-icon k-i-arrow-60-down”></span>
</span>
</span>
<input data-role=”combobox” data-value-primitive=”true” data-text-field=”Name” data-value-field=”OrganizationID” data-placeholder=”- All Organizations -” data-bind=”value: selectedOrganization, source: organizations, events: { change: onOrganizationChange }” style=”width: 100%; display: none;” aria-disabled=”false”>
</span>
</div>
<div class=”col-md-4″>
<span style=”width: 100%;” class=”k-widget k-combobox k-header k-combobox-clearable”>
<span tabindex=”-1″ unselectable=”on” class=”k-dropdown-wrap k-state-disabled”>
<input class=”k-input” autocomplete=”off” style=”” title=”” role=”combobox” aria-expanded=”false” placeholder=”- All Projects -” tabindex=”0″ aria-disabled=”true” aria-autocomplete=”list” aria-owns=”” aria-busy=”false” disabled=”disabled” type=”text”>
<span unselectable=”on” class=”k-icon k-clear-value k-i-close k-hidden” title=”clear” role=”button” tabindex=”-1″></span>
<span unselectable=”on” class=”k-select” aria-label=”select” role=”button” tabindex=”-1″>
<span class=”k-icon k-i-arrow-60-down”></span>
</span>
</span>
<input data-role=”combobox” data-value-primitive=”true” data-text-field=”ProjectNumber” data-value-field=”ProjectNumber” data-placeholder=”- All Projects -” data-bind=”value: selectedProject, source: projects, enabled: selectedOrganization” style=”width: 100%; display: none;” aria-disabled=”true” disabled=”disabled”>
</span>

</div>
<div class=”col-md-4″>
<div class=”form-group”>
<a class=”k-button k-button-primary” data-bind=”click: searchColonies”>Search</a>
<a class=”k-button” data-bind=”click: resetColoniesGrid”>Reset</a>
</div>
</div>
</div>
</div>

Table of Contents What is Hardware Accessibility Testing? Why Hardware Accessibility Testing Matters? Understanding Section 508 Requirements Hardware Accessibility Testing Methods How Can Tx help with Hardware Accessibility Testing? Summary In today’s digital era, tech innovations are major in scaling business operations. From smartphones to smart homes, reliance on technology is increasing daily. However, as … Continue reading “Inclusive Tech: Hardware Accessibility Testing and Section 508”
The post Inclusive Tech: Hardware Accessibility Testing and Section 508 first appeared on TestingXperts.

I’ve gone back and forth on this, and am sort of having a hard time deciding if a “Base page” class is necessary or a good idea.
In most cases this base page class someone stores common functions (or sometimes common locators like headers/footers) and a lot of time these are abstract classes with abstract methods that all child page classes should have (Such as a goto/navigate method all page objects may have or similar “action” methods).
However, I have also seen others argue that we should prefer composition over inheritance: https://stackoverflow.com/questions/49002/prefer-composition-over-inheritance which means we should use utility classes or classes that hold action methods and then use components to pull into our other PoM classes (In the case of a common component such as a header/footer)
I’ve conflicted in whether a base class really ever has a place for PoM? Personally i’ve only ever housed methods such as a goto method that all PoM sub-classes SHOULD have but even that’s probably not 100% necessary.
What are the benefits to one way over the other, and if there is a base class what should be in it?

I have an iFrame in another iFrame, I´am able to switch to the parent iFrame and then to the child iFrame, but I´am just not able to switch back to the parent one. Is it even possible to switch up top to the parent one, as the driver is in the child iFrame?

I have created a POM framework using NUnit in C#. I have created Reporting.cs file which creates reports for the test in that class. How I can generate reports for all tests in different classes without rewriting the reporting code.

BaseTest
– References
– package
– config
– projects
|- project_name
|- pages
|- tests
|- utils
|- reporting.cs

In tests folder files with TestLoginModule.cs have functions

[Test]
public void TestFirst()
{
// test code
}
[Test]
public void TestSecond()
{
// test code
}

In tests folder files with TestDashboardModule.cs have functions

[Test]
public void TestThird()
{
// test code
}
[Test]
public void TestFourth()
{
// test code
}

In Reporting.cs file

[OneTimeSetUp]
public void BeforeClass()
{
// create a test report directory and attach reporter
extent = new ExtentReports();
var dir = AppDomain.CurrentDomain.BaseDirectory.Replace(“/bin/Debug”,””);
DirectoryInfo di = Directory.CreateDirectory(dir + “//Test_Execution_Reports”);
var htmlReporter = new ExtentHtmlReporter(dir + “//Test_Execution_Reports” + “//Automation_Report” + “.html”);
extent.AttachReporter(htmlReporter);
}

[TearDown]
public void AfterTest()
{
var status = TestContext.CurrentContext.Result.Outcome.Status;
var stacktrace = “” + TestContext.CurrentContext.Result.StackTrace + “”;
var errorMessage = TestContext.CurrentContext.Result.Message;
Status logstatus;

switch(status)
{
case TestStatus.Failed:
logstatus = Status.Fail;
test.Log(logstatus, “Test ended with” + logstatus + “-” + errorMessage);
test.Log(logstatus, “screenshot”);
break;
case TestStatus.Skipped:
logstatus = Status.Skip;
break;
default:
logstatus = Status.Pass;
break;
}

SB.Driver.Close();
SB.Driver.Quit();
}

[OneTimeTearDown]
public void AfterClass()
{
extent.Flush();
}

I want to call Reporting.cs OneTimeSetUp and TearDown after every Test in different files

I have a serial E2E test suite that’s growing and getting slower.
To solve this issue, I have to run the tests in parallel. But creating a user and all the required configurations is very complicated in this project.
Having one user per test is also not ideal, as some pieces of the configuration cost money.
So I was thinking of using something similar to Jenkins Lockable Resources or, where each user is a resource that can be “locked” per test and “unlocked” at the end.
Is there a simple API for achieving this? (Or another solution)

I am using Selenium Webdriver on Node.js with Cucumber.js.
I want to run the same test on multiple pages. In this case just checking for 404s in my footer.
My Cucumber .feature file looks like:
Feature: Check footer links

Scenario: Check for broken links in the footer section
Given I am checking the footer on the ‘<page>’ page
Then there should be no broken links in the footer on ‘<page>’ page

Examples:
| page |
| about-us |
| contact-us |
| products |

And in my steps.js file I have:
const { When, Then, Given, AfterAll } = require(‘@cucumber/cucumber’);
const assert = require(‘assert’);
const { Builder, By, until, Key, http } = require(‘selenium-webdriver’);
const firefox = require(‘selenium-webdriver/firefox’);
const XMLHttpRequest = require(‘xhr2’);
var {setDefaultTimeout} = require(‘@cucumber/cucumber’);
setDefaultTimeout(60 * 1000);

Given(‘I am checking the footers on the {string} page’, async function (string) {
this.driver = new Builder()
.forBrowser(‘firefox’)
.build();

this.driver.wait(until.elementLocated(By.className(‘logo-image’)));

await this.driver.get(‘https://www.some-site.com/’ + string);
});

Then(‘there should be no broken links in the footer on {string} page’, async function(string) {
var urlArr = [];
var footerLinks = await this.driver.findElements(By.css(‘.footer a’));
for (let i = 0; i < footerLinks.length; i++) {
var url = await footerLinks[i].getAttribute(“href”);
urlArr.push(url);
}

if (urlArr.length < 1) {
console.log(`Could not find any footer links on ${string} page`);
}
else {
for (let i = 0; i < urlArr.length; i++) {
var respStatus = await checkLink(urlArr[i]);
assert.ok(respStatus==200);
}
}
});

function checkLink(url) {
//Check link function returns status code….
}

This works fine, but for one thing: For each page that is tested a new instance of FireFox opens up.
I tried adding
After(async function() {
this.driver.quit();
});

To the end but this closes the session completely and the other tests fail after the first initial one is done.
Would anyone know how I could repeat the tests in the same browser instance?

we are using streaming platform and we need to test token expiration connected of social media accounts, can some body help me in this? like any tool or method will be helpful.
Thanks in advance.

The eCommerce industry is evolving rapidly with Gen AI at its core. By leveraging AI technology, businesses can generate unique content, personalize recommendations, and improve search functionalities. The blog discusses how it boosts customer experience and drives sales and operational efficiencies. Brands like eBay and Amazon are already seeing significant benefits. Gen AI’s role will become increasingly pivotal as the sector grows, transforming the shopping experience with advanced personalization, AR/VR interactions, and efficient supply chain management.
The post How Can Gen AI Improve eCommerce Customer Experience? first appeared on TestingXperts.

There is a testing techique that I often apply. I have recently decided to name it the First Hurdle Heuristic. The basic idea: get the product out of the starter’s blocks, and see how it performs given a relatively easy challenge. This heuristic can useful when you want to identify problems and risks immediately, or to determine whether a product might not be ready for use or for deeper testing. … Read more

Test Guild – Automation Testing Tools Community
Mastering AI in Test Automation: Expert Tips!
Over the last couple of years, many of my podcast guests who work in the testing industry have spoken about the rapid adoption of AI within their software development teams. During a recent webinar/podcast I hosted with automation testing industry veterans Tal Barmeir and Guy Arieli of Blink.io., for instance, they dropped some real-world knowledge
You’re reading Mastering AI in Test Automation: Expert Tips!, originally posted on Test Guild – Automation Testing Tools Community – and copyrighted by Joe Colantonio