com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure - webdriver

com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Object doesn't support property or method 'createEvent'
I am getting the above error, somebody please help me out on this issue.
Help will be appreciated.
SeleniumServer server = new SeleniumServer(rcc);
DefaultSelenium selenium = new DefaultSelenium("localhost", 1212, "*iexploreproxy", "http://");
server.start();
selenium.start();
selenium.windowMaximize();
selenium.open("URL");
selenium.waitForPageToLoad("25000");
selenium.windowMaximize();
selenium.type("id=lgnLogin_UserName", "dy4cl");
selenium.type("id=lgnLogin_Password", "Test1234");
selenium.click("lgnLogin_LoginButton");
selenium.waitForPageToLoad("10000");
String msg = selenium.getText("//table[#id='lgnLogin']/tbody/tr/td/table/tbody/tr[4]/td");
System.out.println(msg);

Upgrade your Selenium Server file to 2.32.0. you can download it from here
Let me know if you are still facing the same issue.

Related

got this error : An unknown server-side error occurred while processing the command. Original error: Cannot read property 'replace' of undefined

Entered the desired capabilities from appium desktop and started the seesion and got this error : "An unknown server-side error occurred while processing the command. Original error: Cannot read property 'replace' of undefined"
On SetUp should be ("platformName", "iOS")
public void StartDriver()
{
DesiredCapabilities cap = new DesiredCapabilities();
cap.SetCapability("platformName", "iOS");
cap.SetCapability("deviceName", "iPhone Xr");
cap.SetCapability("automationName", "XCUITest");
cap.SetCapability("app","YourApp.app");
cap.SetCapability("autoAcceptAlerts", true);
driver = new IOSDriver<IWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), cap, TimeSpan.FromSeconds(300));
Assert.IsNotNull(driver.Context);
}
It would be better if you could provide more information about your error, but guessing from the error text, this is caused when you do not provide platformName capability.

Getting a 403 response code error from ExoPlayer

I am randomly getting 403 error from google DAI url. Sometime no issue the whole day. Sometime it happens when start playing, sometime it happens after several minutes playing. This happens on live streaming and full screen live streaming.
Here are the logs:
onLoadError() called with: eventTime = [com.google.android.exoplayer2.analytics.AnalyticsListener$EventTime#c2e375b], loadEventInfo = [com.google.android.exoplayer2.source.MediaSourceEventListener$LoadEventInfo#fed7bf8], mediaLoadData = [com.google.android.exoplayer2.source.MediaSourceEventListener$MediaLoadData#db388d1], error = [com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403], wasCanceled = [false]
ExoAnalyticsLogger: onLoadStarted() called with: eventTime = [com.google.android.exoplayer2.analytics.AnalyticsListener$EventTime#bc71f36], loadEventInfo = [com.google.android.exoplayer2.source.MediaSourceEventListener$LoadEventInfo#90eee37], mediaLoadData = [com.google.android.exoplayer2.source.MediaSourceEventListener$MediaLoadData#d7a5fa4]
ExoPlayerImplInternal: Source error.
com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:211)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147)
at com.google.android.exoplayer2.source.hls.HlsMediaChunk.loadMedia(HlsMediaChunk.java:267)
at com.google.android.exoplayer2.source.hls.HlsMediaChunk.load(HlsMediaChunk.java:214)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:320)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
ExoAnalyticsLogger: onLoadError() called with: eventTime = [com.google.android.exoplayer2.analytics.AnalyticsListener$EventTime#65df8c2], loadEventInfo = [com.google.android.exoplayer2.source.MediaSourceEventListener$LoadEventInfo#fda36d3], mediaLoadData = [com.google.android.exoplayer2.source.MediaSourceEventListener$MediaLoadData#6cfd210], error = [com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403], wasCanceled = [false]
Encountered error
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:349)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:211)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147)
at com.google.android.exoplayer2.source.hls.HlsMediaChunk.loadMedia(HlsMediaChunk.java:267)
at com.google.android.exoplayer2.source.hls.HlsMediaChunk.load(HlsMediaChunk.java:214)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:320)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Based from this thread, there might be an issue with the cookie handler/manager. Make sure that you are using the same CookieHandler in both your okhttp service class and the exo player activity. You may also check this link for additional reference.
Check out this thread regarding storing cookies. Assuming you're streaming with Akamai url, the solution solved the 403 issue for me.
Note you'll need to implement
com.squareup.okhttp3:okhttp-urlconnection:4.6.0
com.google.android.exoplayer:extension-okhttp:2.11.4
to get JavaNetCookieJar and OkHttpDataSourceFactory.

Create Custom Json Error in Asp.NET MVC

I am using a JavaScript plug-in and if there is an error it expects format like;
{error: 'You are not allowed to upload such a file.'}
In my MVC Web API I am throwing error like;
var error = string.Format("An error has been occured. Please try again later.");
throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, error));
and it is represented in HTTP response like below;
{"Message":"An error has been occured. Please try again later."}
how can I achieve to return in first way?
You can create an anonymous object
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.InternalServerError,new { error = "your error message here!"}));

Field not found: 'RabbitMQ.Client.ConnectionFactory.VirtualHost'

I'm trying to use RabbitMQ messaging using SignalR.RabbitMQ (https://github.com/mdevilliers/SignalR.RabbitMq) from a queue consumer in c# with the code below:
RabbitMQ.Client.ConnectionFactory factory = new RabbitMQ.Client.ConnectionFactory();
factory.UserName= "username";
factory.Password="password";
factory.HostName="host.name.com";
factory.VirtualHost = "VirtualHost";
factory.Port = 5672;
var exchangeName = "SignalR.Messages";
var configuration = new RabbitMqScaleoutConfiguration(factory, exchangeName);
GlobalHost.DependencyResolver.UseRabbitMq(configuration);
var hubContext = GlobalHost.ConnectionManager.GetHubContext<Chat>();
But unfortunately, fails on:
var configuration = new RabbitMqScaleoutConfiguration(factory, exchangeName);
with the error:
"Field not found: 'RabbitMQ.Client.ConnectionFactory.VirtualHost'."
Same connection works fine on a console app. If I remove the VirtualHost still gives the same error.
No idea what's wrong. Found same error here: https://github.com/MassTransit/MassTransit/issues/204 but doesn't help for me. I use EasyNetQ last version (0.40.3.353) and last version of RabbitMQ Client (3.4.3)
The solution that worked for me invoked using an older version of rabbitmq.client
install-package RabbitMQ.Client -version 3.1.5
Hopefully this helps someone

How to handle 404 errors using webdriver code

Could you please help us how to handle 404 errors using WebDriver code?
Since you haven't provided enough information, I'm assuming that you want to check if request results into 404 then raise an error or display some message.
In following code, I'm requesting for 'Search' link on 'http://www.google.com':
require 'selenium-webdriver'
require 'open-uri'
driver = Selenium::WebDriver.for :firefox
driver.get "http://www.google.com"
search_link = driver.find_element(:link, "Search").attribute("href")
io = open search_link
status = io.status
if status == ["404", "Not Found"]
puts "Request is resulting into 404"
end
Let me know this is what you're looking for or not.
There are multiple ways (using Java), for a URL such as https://www.google.com/sdfsdsdfs :
String actualTitle = driver.getTitle();
assertEquals(actualTitle, "Error 404 (Not Found)!!1" );
or
String pageSource = driver.getPageSource();
if ( pageSource.contains("404") ) assertTrue(true, "404 not found error." );

Resources