Libraries & Frameworks

We can run our tests in different browsers in selenium Webdriver, previously we need to executable files to run our test in any browser. But now we can achieve without using exe files & with the help of WebDriverManager following below syntax to open chrome browser.

WebDriverManager.iedriver().setup();
driver = new ChromeDriver();

Driver class I have defined below code:

public static WebDriver getDriver(){
try{
if(driver == null) {

/* PropertiesFileReader obj=new PropertiesFileReader();
Properties properties=obj.getproperty();
openBrowser(properties.getProperty(“browserName”), properties.getProperty(“URL”)); */
WebDriverManager.iedriver().setup();
driver = new ChromeDriver();
}
}catch(Exception e) {
e.printStackTrace();
}
return driver;
}

I have login page and logintestcase, I am calling getDriver() method from logintest class using below code:

public LoginPage loginpage=PageFactory.initElements(Driver.getDriver(), LoginPage.class);

But I am getting exception :

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
at com.google.common.base.Preconditions.checkState(Preconditions.java:843)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:135)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:35)

and same code is working with .exe files but not when we are loading through WebDriverManager.

I’m Getting this error while executing script

Thread Name: Thread Group 1-1
Sample Start: 2019-10-30 15:58:38 PKT
Load time: 5005
Connect Time: 0
Latency: 0
Size in bytes: 0
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Data type (“text”|”bin”|””):
Response code:
Response message:

[Execution Flow]
– Opening new connection
– Using response message pattern “”
– Using disconnect pattern “”
– Waiting for the server connection for 5000 MILLISECONDS
– Cannot connect to the remote server

[Variables]
– Message count: 0

[Problems]
– Unexpected error: null
JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:189)
JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:141)
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)
java.lang.Thread.run(Unknown Source)

Response headers:

SampleResult fields:
ContentType:
DataEncoding: UTF-8

The situation is that admin sets the Specified fields for the front end user and it is upon admin to decide how many fields he’ll set for the user. One thing is that he can only create 2 types of fields; either Text or Dropdown.

Also, the user can make that field mandatory. Now the question is how can I automate that using selenium and java. I have to check that either these fields are present or not and if present then which type of it and then I have to check that either it is necessary or nor.

Here I am attaching an image from DOM. I think that here Divs has been used.
Also, one thing possible is there is an option that Specified Meetings fields may be not present. So I have to first check that either these fields are present or not. So the scenario will be like this:

Meeting Specifics fields are present or not
The field is of type text or Dropdown
The field is necessary or not
Either the next field exists or not.

In the ever-evolving world of IT operations, understanding the difference between Workload Automation vs Service Orchestration is essential for optimizing your infrastructure. Workload automation focuses on automating repetitive tasks and processes to improve efficiency and reduce manual effort. On the other hand, service orchestration involves coordinating and managing a series of automated tasks to ensure…
The post Workload Automation vs Service Orchestration: What’s the Difference? appeared first on Software Testing Material.

I am calling 2 different endpoints in my jmeter test.
The first endpoint should provide me with a single number (for instance 568959) in its response body and then I must pass it to my second endpoint.

Here is the response of my first endpoint:

please notice the response contains a single number, and it is not a json response as you see in image.

and then I used a Regular Expression Extractor to extract this number from the body using a variable called newsId and regular expression as (.*) as below:

But, when I run my second request, I noticed it is sending an empty ${newsId} such as:

https://www.example.com/blabla/rest/news//publish

Have you ever felt overwhelmed by complex deployment processes or felt it tedious to integrate multiple tools to get things done? Then TOSCA is a great tool that can solve all your problems. But what is the TOSCA Automation tool? How does it work? How exactly can it benefit you? These are all the major
The post TOSCA Automation Tool: What is It? Why Use It? appeared first on Codoid.

Cloud Security Posture Management (CSPM) Importance of CSPM for Modern Enterprises Risks Associated with Cloud Implementation Security Benefits of CSPM Compliance Benefits of CSPM How does Tx help Clients with CSPM? Summary The emergence of cloud solutions offered unlimited opportunities for businesses to expand their operations. Now, the situation is like this: More and more … Continue reading “Why is Cloud Security Posture Management (CSPM) Critical for Modern Enterprises?”
The post Why is Cloud Security Posture Management (CSPM) Critical for Modern Enterprises? first appeared on TestingXperts.

I am running this code:

from selenium import webdriver
from `selenium.webdriver.firefox.options` import Options

Setup:

options = Options()
options.add_argument(“–headless”)

def get_results(search_term):

url = “https://www.wikipaedia.org”
browser = webdriver.Firefox(firefox_options=options, executable_path=r”/usr/local/bin/geckodriver”)
browser.get(url)
search_box = browser.find_element_by_id(“query”)
search_box.send_keys(search_term)
search_box.submit()

try:

links = browser.find_elements_by_xpath(“//ol[@class=’web_regular_results’]//h3//a”)

except:

links = browser.find_elements_by_xpath(“//h3//a”)

results = []

for link in links:

href = link.get_attribute(“href”)
print(href)
results.append(href)

browser.close()

return results

I’m getting error messages:

Traceback (most recent call last):
File “search_items.py”, line 37, in <module>
get_results(“dog”)
File “search_items.py”, line 13, in get_results
search_box = browser.find_element_by_id(“query”)
File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py”, line 351, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py”, line 955, in find_element
‘value’: value})[‘value’]
File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py”, line 312, in execute
self.error_handler.check_response(response)
File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py”, line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id=”query”]

I have tried to solve but it is beyond me.
Any help would be greatly appreciated.

I would like to ask whether it is possible on JMeter to recreate the response on the web browser. Just some quick tip will do. Here is the response that it needs.

My configuration is that I have a CSV file that contains all the ID i need. Then it is inside an Loop controller where I loop it for many times as I needed for selection.

Hope someone can help me. Thanks

I have a scenario, where I want to Assert the UI is displaying ‘Active’.
When debugging the assertion, I am trying different methods.
This is what I started with:
Assert.IsTrue(webdriver.Text.Contains(“Active”))

but it is throwing an exception;
Assert.IsTrue failed

Any recommendations for properly verifying, that the UI displays Active?
Picture attached for reference.