Unable to use launched kdb+tick demo - batch-file

I'm following the following kdb+tick demo: DEMO
There does not seem to be any error when I launch run.bat but all the q instances in the different cmd windows seem to be stuck.
Namely, the q) command does not show up, so after the process has displayed the q.q message, the cursor is blinking on an empty line. Therefore, I am unable to execute any queries.
The only window that does show something is ticker.bat which shows (after q.q message):
k){ON!x y}
'<
#
"q"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://ww..
q))
Why can't I use the other processes? How do I resolve this?

That error in ticker.bat is the process attempting to execute an html file as code. Check what arguments are in ticker.bat then check that source file. I think you'll find you've download html instead of the raw text version.

Related

Jmeter WebDriverSampler fail with Chromedriver headless

I have some tests with WebDriverSampler in Jmeter that work correctly with chromedriver. It is a selenium script that opens a web page and checks that it contains a series of elements. Everything works right until I've tried with the chromedriver headless option.
In this case I get the exception "Expected condition failed: waiting for presence of element located by: By.xpath: ..." as if that element did not exist yet to be loaded. I do not know what can happen, because if I stop using the headless option, if everything works correctly and find the element that really exists.
This is an example of code used(it works without the headless option):
var wait = new support_ui.WebDriverWait(WDS.browser, 30);
var conditions = org.openqa.selenium.support.ui.ExpectedConditions
WDS.sampleResult.sampleStart();
WDS.sampleResult.getLatency();
WDS.browser.get('http://mi-app/');
try{
wait.until(conditions.presenceOfElementLocated(pkg.By.xpath('/ruta_de elemento_existente')));
WDS.log.info('OK')
}catch(e){
WDS.sampleResult.setSuccessful(false);
WDS.sampleResult.setResponseMessage('Fail');
WDS.log.error(e.message)
}
try{
wait.until(conditions.presenceOfElementLocated(pkg.By.xpath('/ruta_de elemento2_existente')));
WDS.log.info('OK2')
}catch(e){
WDS.sampleResult.setSuccessful(false);
WDS.sampleResult.setResponseMessage('Fail2');
WDS.log.error(e.message)
}
WDS.sampleResult.sampleEnd();
I hope someone can help me with this problem, because I need to use the headless option. Thank you very much for your time.
You can print the page source to jmeter.log file by using the following function:
WDS.log.info(WDS.browser.getPageSource())
Or even save it into a separate file like:
org.apache.commons.io.FileUtils.writeStringToFile(new java.io.File('test.html'), WDS.browser.getPageSource())
Or take screenshot on failure like:
WDS.browser.getScreenshotAs(org.openqa.selenium.OutputType.FILE).renameTo(new java.io.File('test.png'))
Check out The WebDriver Sampler: Your Top 10 Questions Answered article for more information.
Also be aware that if the machine where you run your Selenium tests doesn't have GUI you can still normally launch browsers using i.e. Xvfb on Linux or under Local System account on Windows

Handle browser dialog window without focus

I have a Selenium WebDriver based script to automate file uploading. It uploads list of files one by one. I use AutoIT script to handle dialog window, file chooser window. Parameter $CmdLine[1] contains the path of actual file.
ControlFocus("Open a file","","Edit1")
ControlSetText("Open a file","","Edit1", $CmdLine[1])
ControlClick("Open a file","","Button1")
I execute it from Java code as following:
Runtime.getRuntime().exec(autoITExecutable);
It opens dialog window, so it can't work without focus on browser window.
File upload field works like this demo:
https://encodable.com/uploaddemo/
I ran simple script for the link you gave and it works great
import os
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://encodable.com/uploaddemo/")
driver.find_element_by_name("uploadname1").send_keys(os.getcwd() + "/test.csv")
driver.find_element_by_name("email_address").send_keys("none#getnada.com")
driver.find_element_by_name("first_name").send_keys("Tarun")
driver.find_element_by_id("uploadbutton").click()
Try your code in similar format as shown below and try:
WinWaitActive("File Upload") // enter the title of the pop up
Send("Path of the file to enter") // enter the path of the file to upload
Send("{ENTER}") / press enter

<af:message> ignores \n and prints it in a single line

I am new to ADF. Please help. Pasting a snippet of my code:-
I am unable to print a new line message with \n.
<af:message id="errMessage" message="#{backingBeanScope.ta_del_entUiBean.errorMessage}" messageType="error"
visible="#{backingBeanScope.ta_del_entUiBean.error}"/>
public String getErrorMessage()
{
return message;
}
message contains a String this way, say : The following error have occurred. \n 1. Null ponter exception. \n 2. ODBC Exception \n. 3. JDBC Exception
The output is .
The following error have occurred. 1. Null ponter exception. 2. ODBC Exception . 3. JDBC Exception
How do I make it appear as
The following error have occurred.
1. Null ponter exception.
2. ODBC Exception
3. JDBC Exception
Thanks a lot for the help. The Java Platform version is 1.7.0_51 and the `Jdev` version is 12.1.3.0
I had the same issue. But our client was using IE browser. It works well in IE browser.
The problem with the af:message or af:messages components is that they firstly get rendered on the page, and after that, the content will be attached. That's why when you insert a text containing special characters like "\n" or "\r" they will be printed as they are (actually, they are know only to the compiler who knows how to parse them, but remember, you are using an ADF faces component, not the standard output like in the case of System.out.println() ).
With this in mind, it should be clear that you have to instruct the browser how to print the content. How? Easy, just by inserting HTML tags inside your message body. In your case, the message String should be:
<html><body>
The following error have occurred.<br/>
1. Null ponter exception.<br/>
2. ODBC Exception<br/>
3. JDBC Exception<br/>
</body></html>
Or you can enclose the lines within a paragraph tag instead ( < p > ).

How to automate Uploading A file using webdriver.

I am trying to automate a file uploading using webdriver, my HTML is
it is of type file.
using firebug i got the id and it is same for textbox and button.
by using this command getWebDriverObj().findElement(By.id("fileupload")).sendKeys("code.txt"); am unable to fetch the result.
does any one faced this type of situation, if so can you please help me.
Thanks
Raghuram.
Autois Windows specific only.
Here is a more robust solution:
For this you will have find the "id" of the actual input box (where the path of the file is provided) and then use the following command:
driver.findElement(By.id("upload")).sendKeys("/path/to/the/file");
driver.findElement(By.id("upload_button")).click();
If you are using WebDriverBackedSelenium you can use:
selenium.type("locator", "/path/to/the/file");
selenium.click("upload_button");
If previous method is not working
You can try next chain.
1. Call File Select Dialog by click button (use webdriver method click() or javascript "document.getElementById('id').click()"
2. And send control to Autoit (or something another) and AutoIt will work with File Select Dialog (type addres to file, click button)
For example:
var Autoit = new AutoItX3();
const string widowTitle = "File Upload";
Autoit.WinWait(widowTitle, "File &name:", 10);
Autoit.ControlSetText(widowTitle, "", "[CLASS:Edit; INSTANCE:1]", pathToFile);
Autoit.ControlClick(widowTitle, "", "[CLASS:Button; INSTANCE:1]");
Autoit.WinWaitClose(widowTitle, "File &name:", 10);
Setup java and AutoIt http://code.google.com/p/autoitx4java/

Can't get rid of a deleted Settings reference in DataSet.Designer.vb

I had a connection string to a MS Access DB file, Foo.accdb, defined and used in my project. It was defined as a connection string Setting in the Settings section of my project properties. The program referenced the connection string setting and everything worked fine.
Then I decided to replace Foo.accdb with two different DB files, A.accdb and B.accdb each of which would be used under different circumstances. I added connection strings for them in Settings and removed the Setting definition for Foo.accdb connection string.
The name of my application is Foo and the name of the Foo.accdb connection string was FooConnectionString.
But now when I build the program both in debugger and for release I get the following error message:
'FooConnectionString' is not a member of 'Foo.My.MySettings'.
The offending reference, in file FooDataSet.Designer.vb, is:
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Private Sub InitConnection()
Me._connection = New Global.System.Data.OleDb.OleDbConnection
Me._connection.ConnectionString = Global.Foo.My.MySettings.Default.FooConnectionString
End Sub
What is going on here? FooConnectionString is not in any other file in the project directory nor in the My Project subdir. I completely got rid of it in my code and in my project properties yet it persists in FooDataSet.Designer.vb (whatever that is).
While researching this on the web I saw a recommendation to select the FooDataSet.xsd file, right click it and execute the "Run Custom Tool" option. I did this and it appears to rebuild FooDataSet.Designer.vb (the time stamp changes) but the problem persists.
I also tried removing the offending reference by manually editing FooDataSet.Designer.vb but that gave me some other error message.
Why is this old reference staying around and what can I do about it?
This is a standalone app. I'm using VS2008 Standard Ed., VB.Net 3.5
Thanks.
Open the FooDataSet XSD file in a text editor. Right click on dataset in the solution explorer and select "Open With..." and the select XML (text) Editor or open it outside the solution.
Look for the <Connections> tag near the top of the file. Remove the line that looks like this
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="FooConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="FooConnectionString(Settings)" ...

Resources