Wednesday, 15 June 2011

webdriver - When running the web driver script using Java from jar file, i am getting error - java.lang.IllegalArgumentException -



webdriver - When running the web driver script using Java from jar file, i am getting error - java.lang.IllegalArgumentException -

when running web driver script using java jar file, getting error:

java.lang.illegalargumentexception:cannot find elements when xpath look null.

i error while running test executable jar file in command prompt. not error while running eclipse.

the code using:

webelement element = driver.findelement(by.xpath(or.getproperty("fp_simg_id"))); string src = ((javascriptexecutor)driver).executescript("return arguments[0].attributes['src'].value;", element).tostring(); string[] s=src.split("="); system.out.println("value retrieved image source: "+s[1]);

and error received:

c:\project_700creditsolution\700credit>java -jar loginfpwd.jar log4j:warn no appenders found logger (org.apache.http.impl.conn.tsc cm.threadsafeclientconnmanager). log4j:warn please initialize log4j scheme properly. exception in thread "main" java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.eclipse.jdt.internal.jarinjarloader.jarrsrcloader.main(jarrsrcloa der.java:58) caused by: java.lang.illegalargumentexception: cannot find elements when xpa th look null. @ org.openqa.selenium.by.xpath(by.java:112) @ com.ode.login.login_fpwd.main(login_fpwd.java:99) ... 5 more c:\project_700creditsolution\700credit>

any help appreciated.

java webdriver selenium-webdriver

No comments:

Post a Comment