Background script execution in web - Katalon - katalon

we are using katalon studio version 7.8.
We have initiated the script execution and proceeded with other works by accessing File explorer for example.
Script execution is getting stopped and throwing an error “Timed out receiving message from renderer: 10.000”
If focus is moved again to the browser, script execution continues.
Can you share the solution why background execution is getting stopped.
Thanks!

Use headless mode for Chrome.
You can set the headless mode programmatically with
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
System.setProperty("webdriver.chrome.driver", DriverFactory.getChromeDriverPath())
ChromeOptions opt = new ChromeOptions()
opt.addArgument('headless')
ChromeDriver driver = new ChromeDriver(opt)
DriverFactory.changeWebDriver(driver)
WebUI.navigateToUrl('www.katalon.com')

Related

WebdriverIO: couldn't find executable for firefox browser using default runner (devtools:puppeteer)

I'm using webdriverIO for some automation testing and have recently migrated from 'selenium-standalone' service to default wdio devtools protocol.
wdio v.7.16.12
firefox v.95.0.2
From that point I can't start testing with firefox browser:
INFO #wdio/cli:launcher: Run onPrepare hook
INFO #wdio/cli:launcher: Run onWorkerStart hook
INFO #wdio/local-runner: Start worker 0-0 with arg: run,wdio.conf.js
INFO #wdio/local-runner: Run worker command: run
...
INFO devtools:puppeteer: Initiate new session using the DevTools protocol
ERROR #wdio/runner: Error: Couldn't find executable for browser
...
INFO #wdio/cli:launcher: Run onComplete hook
I've tried different combinations of options with 'wdio:devtoolsOptions' and 'moz:firefoxOptions'.
Plus checked whether could help dumpio: true, and 'moz:debuggerAddress': true options.
Also I've tried substitution browserName with product and adding binary and executablePath to capabilities.
When passing binary: 'path.to.firefox' to 'moz:firefoxOptions' options, the error message changes to:
ERROR #wdio/runner: Error: Only Nightly release channel is supported in Devtools/Puppeteer for Firefox. Refer to the following issue:
...
Any ideas how it could be fixed in webdriverIO (without installing separately puppeteer or puppeteer-firefox)?
Thanks!
Seems that I took desired for real.
wdio + devtools:puppeteer still work with Firefox Nightly only – https://github.com/webdriverio/webdriverio/discussions/7916

Dialogflow CX - Location settings have to be initialized - FAILED_PRECONDITION

I am automating Dialogflow CX using Python client libraries. That includes agent/intent/entity etc. creation/updation/deletion.
But for the first time run, I am encountering the below error from python.
If I login to console and set the location from there and rerun the code, it is working fine. I am able to create agent.
Followed this URL of GCP -
https://cloud.google.com/dialogflow/cx/docs/concept/region
I am looking for code to automate the region & location setting before running the python code. Kindly provide me with the code.
Below is the code I am using to create agent.
Error -
google.api_core.exceptions.FailedPrecondition: 400 com.google.apps.framework.request.FailedPreconditionException: Location settings have to be initialized before creating the agent in location: us-east1. Code: FAILED_PRECONDITION
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.FAILED_PRECONDITION
details = "com.google.apps.framework.request.FailedPreconditionException: Location settings have to be initialized before creating the agent in location: us-east1. Code: FAILED_PRECONDITION"
debug_error_string = "{"created":"#1622183899.891000000","description":"Error received from peer ipv4:142.250.195.170:443","file":"src/core/lib/surface/call.cc","file_line":1068,"grpc_message":"com.google.apps.framework.request.FailedPreconditionException: Location settings have to be initialized before creating the agent in location: us-east1. Code: FAILED_PRECONDITION","grpc_status":9}"
main.py -
# Import Libraries
import google.auth
import google.auth.transport.requests
from google.cloud import dialogflowcx as df
from google.protobuf.field_mask_pb2 import FieldMask
import os, time
import pandas as pd
# Function - Authentication
def gcp_auth():
cred, project = google.auth.default(scopes=["https://www.googleapis.com/auth/cloud-platform"])
auth_req = google.auth.transport.requests.Request()
cred.refresh(auth_req)
# Function - Create Agent
def create_agent(agent_name, agent_description, language_code, location_id, location_path):
if location_id == "global":
agentsClient = df.AgentsClient()
else:
agentsClient = df.AgentsClient(client_options={"api_endpoint": f"{location_id}-dialogflow.googleapis.com:443"})
agent = df.Agent(display_name=agent_name, description=agent_description, default_language_code=language_code, time_zone=time_zone, enable_stackdriver_logging=True)
createAgentRequest = df.CreateAgentRequest(agent=agent, parent=location_path)
agent = agentsClient.create_agent(request=createAgentRequest)
return agent```
Currently, Dialogflow does not support configuring the location settings through the API, thus you can not initialise location settings through it. You can only set the location through the Console.
As an alternative, since the location setting has to be initialised only once for each region per project you could set the location and automate the agent creation process, some useful links: 1 and 2.
On the other hand, if you would find this feature useful, you can file a Feature Request, here. It will be evaluated by the Google's product team.
Many thanks Alexandre Moraes. I have raised a feature request for the same.

IE capabilities with Jenkins

I have installed:
selenium grid 2.53.0 hub +node for IE;
Jenkins;
IE 11.
When I try to run a build for IE via batch command with variable BROWSER=ie I'm getting next error:
Error forwarding the new session cannot find : Capabilities [{browserName=internetexplorer, version=null}] (org.openqa.grid.common.exception.GridException) (Selenium::WebDriver::Error::UnknownError)
What can be wrong? Because when I run my tests not via grid everything is ok.
If I connect node for chrome and specify chrome everything is ok too.
Try this:
DesiredCapabilities cap = null;
WebDriver driver = null;
cap = DesiredCapabilities.internetExplorer();
cap.setBrowserName("internet explorer");
cap.setPlatform(Platform.WIN8); //specify the platform
driver = new RemoteWebDriver(new URL(nodeURL), cap);
I resolved this.
I specified incorrectly BROWSER value in Jenkins. Must be BROWSER="internet explorer"

launching appium server through python script gives error

I am launching appium server through terminal by command appium and in another terminal I run my test suite python test.py This works fine.
But if launch through python script I get error between 2 tests
def setup(self):
subprocess.Popen('appium', shell=False)
time.sleep(5)
desired_caps = dict()
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['app'] = os.path.abspath('test.apk')
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
return self.driver
error: Couldn't start Appium REST http interface listener. Requested port is already in use. Please make sure there's no other instance of Appium running already.
The error has no effect tests still pass
I tried adding killall node in teardown
def tearDown(self, driver):
self.driver = driver
self.driver.quit()
subprocess.Popen('killall node', shell=False)
but it gives me error
OSError: [Errno 2] No such file or directory
How can I get rid of error and stop appium server?
Setup is called through launch app -> click some buttons -> call teardown through close app

while importing project in Android Studio throws 'Project refresh failed' error

I am a new bee for Android Studio,
while i import any android gradle(e.g. github.com/k9mail/k-9) project in studio,
it shows a bulk of errors:
Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
Error: Could not find or load main class Xmx512m
i also changed the "Gradle VM option" under File>>Setting >>Gradle to "Xmx512m -XX:MaxPermSize=512m"
but not worked for me.
Also in the "VM option" under File >> Setting >> Compiler(Gradle-based Android Projects) i changed the VM option to Xmx512m -XX:MaxPermSize=512m, but not worked for me,
Please help me out.
Thanks in advance.

Resources