Enter Key throws error when running WDIO on Browserstack - webdriver-io

I'm trying to run some WDIO tests on Browserstack (#wdio/browserstack-service#7.24.0). Using chrome browser and Samsung Galaxy S20 capabilities. There is a point where I need to send Enter key, I'm using .keys('\uE007') and the action is performed on the device as expected, but there is an error coming from BS. ERROR webdriver: Request failed with status 404 due to Error: The URL '/wd/hub/session/0296501ef9a8127fa1f5663921d3b1e52463eaf1/actions' did not map to a valid resource
I tried to use try/catch to prevent that error marking my execution as failed, but try/catch does not stop it. My guess, it is because of async logic during they send key.
so, I need help to prevent that error or find a way to catch it properly.
any suggestion?

Related

Ionic capcitor + vue Network error " Request aborted at e.exports (chunk-vendors.85bc3696.js:1) at XMLHttpRequest.m.onabort" on android emulator

I'm using Ionic/Vue and wheen I run the application in my browser it works well but when I compile and run on an android emulator I get the error below. Please help
Error: Request aborted at e.exports (chunk-vendors.85bc3696.js:1) at XMLHttpRequest.m.onabort (chunk-vendors.85bc3696.js:26)
That error indicates that some of your vue components gets destroyed before ajax request gets completed. Check over all your code - everywhere you invoke remote service make sure that you 'await' result before allow anything to switch to another route, which leads to components disposal. Sometimes you need to do 'unsubscribe' from http request in component disposal
Actually, that probably is not an error - that is normal that request gets aborted if result is not needed anymore

How to fix 'Request error : authentication failed empJAgent.exe' error in Oracle loading test?

I'm trying to make my first load adf test. I have chosen software from Oracle "Oracle Application testing suite". But after probably first good test everything that I'm trying to test receives an error response even empty scenario ( of course from open script).
I tried lots of combinations in settings in OpenScript and all of the requests in this app are passed. We can find errors only in Oracle Load tests app. I don't have any idea what should I do. Can you give me any advice?
Every request responds showing this error:
Request error : authentication failed empJAgent.exe

Getting error "org.openqa.selenium.WebDriverException: java.net.ConnectException: Connection refused:"

I am using selenium webdriver for the testing application. i am using using Marionettedriver for the browser. however when I run the code it gives the error "org.openqa.selenium.WebDriverException: java.net.ConnectException: Connection refused:" I have check the system path also no issue in the same.
so please suggest how to solve the error.
Also getting error " error: Found argument '--webdriver-port' which wasn't expected, or isn't valid in this context
USAGE:
geckodriver.exe [FLAGS] [OPTIONS]".
I am not able to understand for what issue this error is appears. So please let me know how to solve this
I have used the jar file for selenium server and selenium standalone server in the project. still same error shows. Also as mentioned above it shows the error of " error: Found argument '--webdriver-port' which wasn't expected, or isn't valid in this context
USAGE:
geckodriver.exe [FLAGS] [OPTIONS]".
When you run your webdriver tests, you need to "obtain" browser from selenium server/grid. Connection refused message means there is no listening server on a host/port you provided.

403 : Access forbidden selenium

I want to run my testcases with the help of parameters mentioned in the testSuite.xml file and use them in my test cases by mentioning
#Parameters({ "selenium.host", "selenium.port", "selenium.browser", "selenium.url" }) in my code.
Though, I started a standalone server with -trustAllSSLcertificates, the system is giving "403 access forbidden error". However, if I run the test cases individually, by hardcoding the port, URL, Host & browsername, it works fine.
Where am i going wrong?.....
BTW, I run my test cases using build.xml file. Here also i added the -trustAllSSLcertificates when starting the server. But still it does not work.
Please help.
When running Selenium WebDriver using selenium-server-standalone I kept getting this error.
HTTP ERROR: 403
Forbidden for Proxy
RequestURI=/session
Turns out that it was because I needed to use the url http://localhost:4444/wd/hub as the url for the RemoteWebDriver client to connect to.
I'm sure there are a number of things that could cause the HTTP ERROR: 403, but you may want to double-check that it's resolving to the correct base url.

Don't stop on HTTP error 403

In one of my Selenium test cases, I try to ensure that certain pages can't be accessed. Instead, HTTP return code 403 should be given.
However, here Selenium terminates test execution with the following exception:
com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = http://user:password#www.example.com/admin Response_Code = 403 Error_Message = Forbidden
Any way to work around that?
Seems like I have to answer the question myself...
I now surround the "open" call with a try...catch block. There, I parse the exception message if it contains the 403 code and XHR ERROR. Seems to me not very clean, but it works.
I was trying to test for HTTP 403 errors using PHPUnit. I examined the PHPUnit Selenium Extension code and found that the driver ends the session as soon as it receives a bad response, and there does not appear to be a way to bypass this functionality.
I ended up using a try-catch solution and restarting the Selenium session:
try {
$this->open('restricted_url');
$this->assertTitle('The page cannot be displayed');
} catch (PHPUnit_Framework_Exception $e) {
$this->start();
}
When the Selenium session is restarted, all the session information is lost, as is to be expected, so you will need to build your session again in order to run more tests:
$this->loginAsGuest();
try {
$this->open('admin_url');
$this->assertTitle('The page cannot be displayed');
} catch (PHPUnit_Framework_Exception $e) {
$this->start();
$this->loginAsGuest();
}
I don't know what language you're using, but I think you can get around this by instructing Selenium to ignore the status code when opening a page.
In Ruby:
#browser.remote_control_command('open', [url, 'true'])
In C#:
((DefaultSelenium)selenium).Processor.DoCommand("open", new string[]{url, "true"}))
I believe the behavior in Selenium trunk is to now ignore the status code by default. So, you could try building that and see if it works out for you.