Kamal Ahmed

Ranch Hand
+ Follow
since Feb 15, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kamal Ahmed

hi,
I am surprised to see no Solr or Lucene forum on JavaRanch. i think it would be nice and helpful to have these forums.
Thanks,
-Kamal
10 years ago
When trying to send text to a TextBox created via PrimeFaces:

I try:

getDriver().findElement(By.id("addRowTable:0:hostName")).sendKeys("testing");

Html is:

<HTML>
<label>Enter Hostname:</label><script id="addRowTable:0:j_idt474_s" type="text/javascript">$(function() {PrimeFaces.cw('Watermark','widget_addRowTable_0_j_idt474',{id:'addRowTable:0:j_idt474',value:'Hostname',target:'addRowTable:0:hostName'},'watermark');});</script>
<span class="zoneName"><input id="addRowTable:0:hostName" name="addRowTable:0:hostName" type="text" maxlength="254" size="20" class="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all" /><script id="addRowTable:0:hostName_s" type="text/javascript">PrimeFaces.cw('InputText','widget_addRowTable_0_hostName',{id:'addRowTable:0:hostName'});</script>.xxxxcxxxxxdddddddddd.net</span></td>

</HTML>

I get the XPath as:

//*[@id="addRowTable:0:hostName"]

I get exception:

org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"id","selector":"addRowTable\\:0\\:hostName"}
Command duration or timeout: 149 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html

When i look at

http://seleniumhq.org/exceptions/no_such_element.html

i get a generic explanation:

The element may not be present.

Even Escaping : with \\ did not work

getDriver().findElement(By.id("addRowTable\\:0\\:hostName")).sendKeys("testing");
11 years ago
JSF
best in what way, if you can elaborate please that would help.
11 years ago
but i actually see it in the jar:


jar tvf dom4j.jar | grep SAXReader*

1061 Mon Jan 25 09:34:34 EST 2010 org/dom4j/io/SAXReader$SAXEntityResolver.class
13170 Mon Jan 25 09:34:34 EST 2010 org/dom4j/io/SAXReader.class

11 years ago
Hi,

I am trying to compile the following class on Linux




i compile it using:

javac -cp /usr/share/java/dom4j.jar Main.java

But when i am trying to run it, i get Exception:


$ java Main

Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/io/SAXReader
at Main.main(Main.java:31)
Caused by: java.lang.ClassNotFoundException: org.dom4j.io.SAXReader
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 1 more

Any idea on how to resolve this ?

Thanks,
11 years ago
yes, i see it now. my mistake.
I meant to write com.google.json....
Please accept my apologies.
-Kamal.
You are implying that gson and json can be interchangebally used ?
I tried gson , but it does not have the same method or naming path's
i have looked just about every where.

Thanks,
-Kamal.
Hi,
Is there any documentation on how to setup the built-in tests that come with the source of HtmlUnit? I am trying to run BinaryPageTest in Eclipse, and get the following error:

Class not found com.gargoylesoftware.htmlunit.BinaryPageTest

13 years ago
sorry, i looked further, and in the method getResponseBody(), there is a limit imposed UFFER_WARN_TRIGGER_LIMIT, 1024 * 1024);

you might want to either get the source code, and increase the limit, OR better, use another getter for the body


15 years ago
try new InputStreamReader()
15 years ago
Hi,

I am trying to find , evaluate and then use a Web Testing tool which will enable me to use Java and by pass IE or Firefox, and be able to do it programmatically, so i can automate it.

Thanks,
-Kamal.
16 years ago
Hongli Li,

You are right on the dot.

I was not seeing the message because the logging level in log4j.xml was set to WARN



Thanks for the tip
16 years ago
Hi,

I have a BaseTest Class with the log4j logger as:

Now, in the test class, i call :

Now, when i run the testMethod() i SHOULD get a Log4J Logging statement on stdout

but, i am not getting Anything on stdout , Any ideas?

Thanks,
-Kamal.
16 years ago