Software Engineering

I’m trying to use a custom profile in Firefox with an add-on, I can open the profile, launch URL, I even see the add-on icon on top bar but is always set into the disabled mode, I need to set it to active all time. The add-on is ‘anonymous’
below is what I did, but no success.

public class SeleniumScript {
static WebDriver driver;
public static void main(String args[]) throws Exception {
System.setProperty(“webdriver.gecko.driver”, “E:\Library\geckodriver-v0.21.0-win32\geckodriver.exe”);
ProfilesIni profile2 = new ProfilesIni();
FirefoxProfile profile3 = profile2.getProfile(“AutoProfile”);
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setProfile(profile3);
File file = new File(“C:\Users\xxx\AppData\Roaming\Mozilla\Firefox\Profiles\vjo848oc.AutoProfile\extensions\client@anonymox.net.xpi”);
profile3.addExtension(file);
profile3.setPreference(“extensions.anonymox.currentVersion”, “4.1”);
driver = new FirefoxDriver(firefoxOptions);
String baseURL = “http://abc.com”;
driver.get(baseURL);
driver.manage().window().maximize();
}
}

I have an HTML element with a disabled attribute that is either true or `false, like:
<div class=”row” disabled=”false”>

or
<div class=”row” disabled=”true”>

I thought this would be straightforward to verify in Cypress by doing something like:
cy.get(“div.row”).should(“have.attr”, “disabled”, “false”)

However, when I tried that the test fails because Cypress reports that the disabled attribute of the element does not have the value “false” but instead has the value “disabled”.
If I open the browser inspection tool I can verify that the attribute is shown as I’ve written above. Any idea what is going wrong?

<select id=”SelectedCustomerRoleIds” multiple=”multiple” name=”SelectedCustomerRoleIds” data-role=”multiselect” aria-disabled=”false” style=”display: none;” xpath=”1″>
<option value=”1″>Administrators</option>
<option value=”2″>Forum Moderators</option>
<option value=”4″>Guests</option>
<option value=”3″ selected=”” style=””>Registered</option>
<option value=”5″>Vendors</option></select>

I have tried the following code to deselect option 3 – Registered and select option 4 – Guests.
WebElement element= driver.findElement(By.id(“SelectedCustomerRoleIds”)):
Select select = new Select(element): select.deselectByValue(“3”):
select.selectByValue(“4”)

I’m using SoapUI to test REST webservices and I’m stuck on an issue.
I have a json object, called coverages, which consists of one or more other objects, it looks something like this (example with 2 coverages):
“coverages” : [
{
“CovNr” : 123,
“CovDesc” : “My coverage”
},
{
“CovNr” : 456,
“CovDesc” : “Another coverage”
}
]

The thing is, sometimes there is one coverage, and sometimes there are multiple. This means I need the coverages object to be variable, and have either one or more coverages as its body, depending on # of coverages.
Since the number of coverages isn’t always the same I can’t use properties for the CovNr and CovDesc attributes. Also I can’t just always add like three and leave two empty if only one is used (can’t have empty attributes).
I tried to set a coverages property using groovy script, which consisted of the entire body of the coverages object, but that didn’t work (I’m guessing the editor can’t parse an entire part of a request from a property).
Example of what I tried:
in groovy:
def coverages = “[ { “CovNr” : 123, “CovDesc” : “My coverage” }, { “CovNr” :456, “CovDesc” : “Another coverage” }]”
testRunner.testCase.setPropertyValue(“coverages”, coverages)

in request body:

“coverages” : “$(#TestCase#coverages)”,

This didn’t work.
Is there another way to add a variable number of coverages to my request body?

Code:

public class AppDAta {
public static URL url;
public static DesiredCapabilities capabilities;
public static AndroidDriver<AndroidElement> driver;

//1
@Test
public void setupAppium() throws MalformedURLException {
//2
final String URL_STRING = “http://127.0.0.1:4723/wd/hub”;
url = new URL(“http://127.0.0.1:4723/wd/hub”);

//3
DesiredCapabilities cap= new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.DEVICE_NAME, “Nexus_4_API_27”);
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, “android”);
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, “3.6.0”);
cap.setCapability(MobileCapabilityType.APP, “/Users/uss/Desktop/untitled folder/Appium/src/main/java/Appium/ApiDemos-debug.apk”);
cap.setCapability(MobileCapabilityType.NO_RESET, true);
// cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, “XCUITest”);
cap.setCapability(“useNewWDA”, false);
//4
AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(url, cap);
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
//driver.resetApp();
}

}

Getting this type of error in console:

FAILED: setupAppium
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
Build info: version: ‘3.6.0’, revision: ‘6fbf3ec767’, time: ‘2017-09-27T15:28:36.4Z’
System info: host: ‘tests-Mac-mini.local’, ip: ‘fe80:0:0:0:431:f1c:51d3:566a%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.13.6’, java.version: ‘1.8.0_111’
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.

Azure DevOps is triggering and running tests on a VM.
All my tests are working fine on local machine.
On VM, While trying to launch Chrome browser using ChromeDriver and WebDriverManager, tests are failing at LaunchChromeDriver method with failure as ‘Access is Denied’ at step new ChromeDriver(options);
This is how the method looks like:
public static IWebDriver LaunchChromeDriver()
{
try
{
new WebDriverManager.DriverManager().SetUpDriver(new ChromeConfig());
ChromeOptions options = new ChromeOptions();
driver = new ChromeDriver(options);
return driver;
}
catch(Exception e)
{
log.info(“Exception is “+e);
return null;
}
}

Am I missing something or do I need to modify the code?
Did anyone experience the same?
Getting an exception as below:

System.ComponentModel.Win32Exception (0x80004005): Access is denied
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at OpenQA.Selenium.DriverService.Start()
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)

My current project is written in C++. It takes a certain config file to do various work. There are a large number of parameters inside the config. I would like to do randomization test for those inputs. What I would like to achieve is following:

For each parameters, I do uniformly randomization with its own constraints.
The whole testing sample would be drawn uniformly from whole parameter space.

I am new to software testing. What I would like to achieve is something like UVM does for hardware verification. I am wondering if there is any framework for this. Python is preferred.
Thanks

Hope you doing well,

I’m trying to dragAndDrop an element from FrameOne to FrameTwo but not able to do so.Please help me to understand the concept and what I’m doing wrong here and need to achieve the task by using Actions class only.

Here’re the URLs :

https://www.w3schools.com/html/html5_draganddrop.asp
Here the element is in a div block I’m able to get all the locaters and do all other actions using Actions class but not able to drag and drop the element.

2.https://codepen.io/rjsmer/full/vvewWp

Here I’m trying to move the element from Frame one to Frame two but I’m not able to do so.

I’ve tried dragAndDrop(),ClickAndHold() methods,Searched so many solutions, watch videos on the same with no success.

package DragAndDropPracticeFrame;

import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;

import static io.github.bonigarcia.wdm.DriverManagerType.CHROME;

public class DragDropFrame {
public static void main(String[] args) throws InterruptedException {
WebDriverManager.getInstance(CHROME).setup();
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get(“https://codepen.io/rjsmer/full/vvewWp”);
driver.switchTo().frame(“result”);
System.out.println(“Inside First Frame.”);
WebElement frameOne =
driver.findElement(By.cssSelector(“iframe.dragFrame.dragDrop”));
driver.switchTo().frame(frameOne);
System.out.println(“Inside Frame 3”);
WebElement elementOne = driver.findElement(By.id(“dragFrame-0”));
System.out.println(“First element found: ” + elementOne.getText());
Actions builder = new Actions(driver);
driver.switchTo().defaultContent();
System.out.println(“Inside main page”);
driver.switchTo().frame(“result”);
//System.out.println(“Switched to Frame First”);
WebElement frameThree =
driver.findElement(By.xpath(“//iframe[@class=’dropFrame dragDrop’]”));
Action action =
builder.clickAndHold(elementOne)
.moveToElement(frameThree)
.release(frameThree).build();

//driver.switchTo().frame(frameTwo);
//System.out.println(“Switched to frame 3”);
action.perform();

//driver.switchTo().defaultContent();
//builder.perform();

}
}

Another try :

WebDriverManager.getInstance(CHROME).setup();
WebDriver driver = new ChromeDriver();
driver.get(“https://codepen.io/rjsmer/full/vvewWp”);
driver.switchTo().frame(0);
WebElement frameOne = driver.findElement(By.xpath(“//iframe[@class=’dragFrame dragDrop’]”));
WebElement frameTwo = driver.findElement(By.xpath(“//iframe[@class=’dropFrame dragDrop’]”));
driver.switchTo().frame(frameOne);
// identify element in first frame
WebElement elementOne = driver.findElement(By.id(“dragFrame-0”));

// Use Actions class for tap and hold
Actions actions = new Actions(driver);
Actions action = actions.clickAndHold(elementOne);
actions.build();
action.perform();

// switch to the second frame
driver.switchTo().frame(frameTwo);

// move element to another frame
WebElement elementTwo = driver.findElement(By.xpath(“//body[@class=’frameBody dropFrameBody’]”));
Actions actions2 = new Actions(driver);
Actions action2 = actions2.moveToElement(elementTwo);
actions2.release(elementOne);
actions2.build();
action2.perform();

Expected: The element should move to Frame 3 Actual: Nothing happened.

I have a value with the following format [aadrzr@r2za$l919d@ldzkld], but when asserting this value in the response assertion, I am getting a failed response assertion. Since it contains special characters.
How I can solve this. Notice that the value is auto generated and I don’t know what value format will be retieved.
Example:
“key”: “aadrzr@r2za$l919d@ldzkld”,
Response assertion :
failed

I am wondering if there is a way to know how many threads JMeter can support for a given machine configuration? Currently, I am working toward a task that requires me to check how many VMs I need to support different API threads.

I’ve looked in http://products.prqa.com/Unix/Linux/QAC_PRQAF/QAC-9.4.1-ReleaseNotes.pdf and it doesn’t feature. Any ideas where this is defined? It’s also not defined in the PRQA framework.
Update:
This is for MISRA compliance.

I’m trying to send nested JSON through Cucumber data table. I have the following scenario, I have tried Scenario Outline too but it didn’t resolve the issue.
Scenario: provider edits new productWorkingDate
Given productWorkingDates is edited with following fields
| id | productId | fromDate | toDate | name | strictHours | maxUsedTicketsQuantity | errorCode |
| bpvjPBpJ | WaNX2QOd | 2022-07-01 | 2022-12-01 | Test55 | false | 0 | 0 |
And TimeSlots is edited with following fields
| dayOfWeek | startTime | endTime | duration | quantity | usedQuantity | active |
| Sunday | 14:00:00 | 15:00:00 | 02:00:00 | 0 | 0 | true |
| Monday | 14:00:00 | 15:00:00 | 02:00:00 | 0 | 0 | true |

Then verify status code is 200

and I have the following step definition
@And(“^TimeSlots is edited with following fields$”)
public void timeslotsIsCreatedWithFollowingFields(List<Map<String, String>> expectedTimeSlots) {
TimeSlots timeSlots = new TimeSlots();

for(int i = 0; i < expectedTimeSlots.size(); i ++) {
timeSlots.setDayOfWeek(expectedTimeSlots.get(i).get(“dayOfWeek”));
timeSlots.setStartTime(expectedTimeSlots.get(i).get(“startTime”));
timeSlots.setEndTime((expectedTimeSlots.get(i).get(“endTime”)));
timeSlots.setDuration(expectedTimeSlots.get(i).get(“duration”));
timeSlots.setQuantity(Integer.parseInt(expectedTimeSlots.get(i).get(“quantity”)));
timeSlots.setUsedQuantity(Integer.parseInt(expectedTimeSlots.get(i).get(“usedQuantity”)));
timeSlots.setActive(Boolean.parseBoolean(expectedTimeSlots.get(i).get(“active”)));

}

Actual output is :
{
“productWorkingDate”: {
“id”: “bpvjPBpJ”,
“productId”: “WaNX2QOd”,
“fromDate”: “2022-07-01”,
“toDate”: “2022-12-01”,
“name”: “Test55”,
“strictHours”: false,
“timeSlots”: [
{
“id”: “Wlqb8XOb”,
“productWorkingDateId”: “bpvjPBpJ”,
“dayOfWeek”: “Monday”,
“startTime”: “14:00:00”,
“endTime”: “15:00:00”,
“duration”: “02:00:00”,
“quantity”: 0,
“usedQuantity”: 0,
“active”: true,
“deletedAt”: null
}
],
“deletedAt”: null,
“maxUsedTicketsQuantity”: 0,
“errorCode”: 0
},
“maxUsedTicketsQuantity”: 0,
“error”: null,
“errorCode”: 0
}

Expected output is :
{
“productWorkingDate”: {
“id”: “bpvjPBpJ”,
“productId”: “WaNX2QOd”,
“fromDate”: “2022-07-01”,
“toDate”: “2022-12-01”,
“name”: “Test55”,
“strictHours”: false,
“timeSlots”: [
{
“id”: “4lrn8old”,
“productWorkingDateId”: “bpvjPBpJ”,
“dayOfWeek”: “Sunday”,
“startTime”: “14:00:00”,
“endTime”: “15:00:00”,
“duration”: “02:00:00”,
“quantity”: 0,
“usedQuantity”: 0,
“active”: true,
“deletedAt”: null
},
{
“id”: “dOnz85OV”,
“productWorkingDateId”: “bpvjPBpJ”,
“dayOfWeek”: “Monday”,
“startTime”: “14:00:00”,
“endTime”: “15:00:00”,
“duration”: “02:00:00”,
“quantity”: 0,
“usedQuantity”: 0,
“active”: true,
“deletedAt”: null
}
],
“deletedAt”: null,
“maxUsedTicketsQuantity”: 0,
“errorCode”: 0
},
“maxUsedTicketsQuantity”: 0,
“error”: null,
“errorCode”: 0
}

I am new to JMeter + WebDriver + Java. JavaScript code is working as expected for screenshot. Due to recent upgrade of Java, we are moving from JavaScript to Java.
Below is the code. Can you please help with it?
import org.openqa.selenium.By;
import org.openqa.selenium.support.events.EventFiringWebDriver;
import org.openqa.selenium.support.ui;
import java.io.File;
import org.apache.commons.io.FileUtils;
import Java.awt.Robot;
import java.awt.image.BufferedImage;

WDS.sampleResult.sampleStart();

WDS.browser.get(“https://www.google.com/”);
Thread.sleep(10);

TakesScreenshot ts = (TakesScreenshot)WDS.browser;
File srcFile = ts.getScreenshotAs(OutputType.FILE);
File destFile = new File(“/Users/****/desktop/screenshot.png”);
try{
FileUtils.copyFile(srcFile, destFile);
} catch (IOException e) {
e.printStackTrace();
}

WDS.sampleResult.sampleEnd();

Also I tried below code
File mFile = ((TakesScreenshot)WDS.browser).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(mFile, new File(“output/” + WDS.name + “-” + WDS.parameters + “.png”));

Error message:
2022-05-03 11:28:51,641 ERROR c.g.j.p.w.s.WebDriverSampler: Sourced file: inline evaluation of: “import org.openqa.selenium.By; import org.openqa.selenium.support.events.EventFi . . . ” : Typed variable declaration : Class: TakesScreenshot not found in namespace : at Line: 14 : in file: inline evaluation of: “import org.openqa.selenium.By;
import org.openqa.selenium.support.events.EventFi . . . ” : TakesScreenshot in inline evaluation of: “import org.openqa.selenium.By;
import org.openqa.selenium.support.events.EventFi . . . ” at line number 14

I created a test script to sign in and sign out an application and tested the script with a single user.
The aggregate report shows average time as 72 secs for sign out for just 1 user. But when I manually sign out the application, it is getting done in 2 seconds itself.
Why is this?

Here is my script –
next=WDS.browser.findElement(pkg.By.xpath(“//button[contains(@class,’btn btn-sm btn-light border ml-3′)]”))

while(next.isEnabled()==true)
{
//java.lang.Thread.sleep(4000);

var wait19 =new org.openqa.selenium.support.ui.WebDriverWait(WDS.browser, 9000)
wait19.until(org.openqa.selenium.support.ui.ExpectedConditions.elementToBeClickable(pkg.By.xpath(“//button[contains(@class,’btn btn-sm btn-light border ml-3′)]”))).click()

next=WDS.browser.findElement(pkg.By.xpath(“//button[contains(@class,’btn btn-sm btn-light border ml-3′)]”))
//WDS.log.info(WDS.browser.getPageSource())
if (!next.isEnabled()) {
WDS.log.info(‘Next button disabled’)
break
}
}

In my application, I need to visit total 300 pages and calculate time taken to traverse from first page to last.
But, when click on next button, it throws exception:
ERROR c.g.j.p.w.s.WebDriverSampler: element click intercepted: Element <button _ngcontent-pde-c133=”” class=”btn btn-sm btn-light border ml-3″>…</button> is not clickable at point (226, 567). Other element would receive the click: <div _ngcontent-pde-c109=”” class=”overlay ng-tns-c109-11 ng-trigger ng-trigger-fadeIn ng-star-inserted ng-animating” style=”background-color: rgba(0, 0, 0, 0.8); z-index: 99999; position: fixed;”>…</div>
How do I resolve it?

I’m trying to compare two strings using this code in a switch statement:
case “medStepOne”:
WebEligibilityMedFirst.SelectOptions(p0);
if (!p0.Equals(“failOne”) || !p0.Equals(“failTwo”) || !p0.Equals(“failThree”) || !p0.Equals(“failFour”))
{
WebEligibilityMedSecond.SelectOptions(p0);
}
break;

The string is definitely “failOne” so I believe that the code should bypass the if statement but it does not.

I have copied some text from the website and then pasted it into the text file. And also I did the same thing to paste the second text using the “Append To File” keyword.
I want to paste the first text in the first row and the second text in the next row. How could I do that?
This is what I have so far,
*** Test Cases ***
TC_01
Open Browser ${BASE_URL} gc
EXECUTE JAVASCRIPT window.scrollTo(200,400)
sleep 5s

${Text} = Get Text xpath=//div[2]/md-card/header/h2
${Value} = Get Text css=.recommended-size
createFile C:/MyProjects/Records/File.txt ${Text}
Append To File C:/MyProjects/Records/File.txt ${Space}
Append To File C:/MyProjects/Records/File.txt ${Value}

log to console success
sleep 2s

I got the result as the above screenshot, and what I want to do is, I want to paste the “1km” on the next line.
Please help to solve this issue. Any guidance and advice will be greatly appreciated!

This blog discusses the significant role of AI-driven intelligent systems in transforming data management. It emphasizes how ML and NLP are pivotal in enhancing data accuracy and enabling real-time decision-making. By automating processes and improving predictive analytics, AI facilitates efficient and informed decisions across different sectors. Examples from healthcare and e-commerce illustrate AI’s effectiveness in areas like fraud detection and enhancing customer experiences. Adopting intelligent systems can help businesses optimize operations and maintain a competitive edge in a tech-driven world.
The post Transforming Data Management: The Impact of AI-Driven Intelligent Systems first appeared on TestingXperts.

This is a lightly-edited excerpt from a longer blog post that you’ll find here. I recommend you read it too, but if you’re short on time, here’s the core of it. If you care about understanding the status of your product, you’ll probably care about testing it. You’ll want testing to find out if the product you’ve got is the product you want. If you care about that, you need … Read more

I am trying to translate cucumber into XRay for Jira issues with the right structure. The result should be issues with Test Executions I can run for every example.

I want to make a test with multiple ‘Examples’ a-la Scenario Outlines in Cucumber.

Am I wanting to do Test Sets? A Test Plan?

Something else? I need an XRay for Cucumber testers intro.

Example fake Scenario Outline.

Scenario Outline: Ensure privs restricted
Given I am logged onto “<container>”
And I run the priv check
Then privs are restricted
Examples:
| container |
| rabbit1 |
| zalenium1 |
| zalenium2 |

Thanks.