biraj joshi

Ranch Hand
+ Follow
since Mar 10, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by biraj joshi

I have built a java application(jar) using selenium webdrivers that opens a url(form) in internet explorer and do some form posting.But in Internet explorer 11 i m getting an exception(javascript error) while opening the form..After hours of a research i found an update of internet explorer 11 i.e Security update for Microsoft windows (KB3025390) is causing problems in opening the page. If i delete that update then its working fine as before.. Is there any way to check this update from my java code so that i can throw a message(dialog-box) to delete this update.
9 years ago
hi
i am recently working on a java desktop application(jar) with the help of selenium webdriver.what it basically does is it opens a webpage(https) in a webbrowser in this case ie8 and does some form posting. But its unable to open the webpage(https) in ie unless i add the site in trust site zone of ie. I tried it on other browsers firefox and chome there is no problem,no tursting issues, the webpage is opened directly with ease.Why is it so in internetexplorer ? Why i have to trust the site in ie?

Please help. Thanks in advance
10 years ago
i have built an application using jdk 6 and i m using selenium 2.40. My program successfully runs in windows 7 and 8 but when i try to run it in Windows xp it throws the following exception.

INFO: Retrying request
org.openqa.selenium.WebDriverException: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 46 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DTA01-3F-ITD12', ip: '192.168.214.53', os.name: 'Windows XP'
, os.arch: 'x86', os.version: '5.1', java.version: '1.7.0_51'
Session ID: 3b9bdf76-9fc2-42ed-9010-24c4748bbe53
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0
, ignoreZoomSetting=true, enablePersistentHover=true, ie.ensureCleanSession=fals
e, browserName=internet explorer, enableElementCacheCleanup=true, unexpectedAler
tBehaviour=dismiss, version=8, ie.usePerProcessProxy=false, cssSelectorsEnabled=
true, ignoreProtectedModeSettings=true, requireWindowFocus=false, handlesAlerts=
true, initialBrowserUrl=https://www.himalremit.com/newpcregistration.php, ie.for
ceCreateProcessApi=false, nativeEvents=true, browserAttachTimeout=0, ie.browserC
ommandLineSwitches=, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.
java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHa
ndler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.ja
va:573)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDri
ver.java:482)
at hbl.remit.com.Browser.main(Browser.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)

This is my code

DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability("ignoreProtectedModeSettings", true);
caps.setCapability("ignoreZoomSetting", true);
caps.setCapability("javascript.enabled", true);
caps.setCapability("initialBrowserUrl","https://www.gigle.com/preregistration.php");
WebDriver driver = new InternetExplorerDriver(caps);
driver.get("https://www.gigle.com/preregistration.php");
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("document.getElementsByName('caminfo').item(0).value = '"+regValue+"';");
jse.executeScript("document.getElementsByName('reqip').item(0).value = '"+ipAddr+"';");
jse.executeScript("document.getElementsByName('phyid').item(0).value = '"+PHYID+"';");
jse.executeScript("document.getElementsByName('hdid').item(0).value = '"+BIOSID+"';");

WebElement element = driver.findElement(By.name("Submit"));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", element);

Basically what it does is it submits above values in a form and submit the form.

The preregistration.php is this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Himal Remit</title>
<script language = "JavaScript">
function setCount(target){
if(target == 0) document.f1.action="https://www.gigle.com/registration.php";
document.f1.submit();
}
</script>
</head>
<body>
<form action="" method="post" name="f1">
<input type="hidden" name="caminfo" value="" id="caminfo">
<input type="hidden" name="reqip" value="" id="reqip">
<input type="hidden" name="phyid" value="" id="phyid">
<input type="hidden" name="hdid" value="" id="hdid">
<input type="submit" name="Submit" hidefocus="true" style="height: 0px; width: 0px; border: none; padding: 0px;" onClick="setCount(0)">
</form>
</body>
</html>

Please help.
THanks
10 years ago
I dont know the folder name. how to get foldername from its file name
10 years ago
Hi
Can we delete the folder too when deleting the file inside it using Runtime.exec() function.I have the file name buy not the folder name.So when my code deletes that file inside the folder i want the folder to be deleted as well,as its empty.

Thanks in advance
10 years ago
Hi
I have a situation.

String tmpfolder = System.getProperty("java.io.tmpdir"); \\ this is the path: C:\Users\biraj\AppData\Local\Temp\
tmpfolder = tmpfolder.replace("\\", "\\\\");
Runtime.getRuntime().exec("cmd /c del "+tmpfolder+"IEDriver.dll /f /s /q");

When i run this code it doesnot delete the IEDriver.dll file.
But when i give the static path of the temporary folder then it deletes that file

Runtime.getRuntime().exec("cmd /c del C:\\Users\\biraj\\AppData\\Local\\Temp\\IEDriver.dll /f /s /q");

Can anyone explains me why the first code didnt work.whats wrong in that.
THanks
10 years ago
Hi i m using selenium webdriver internet explorer. Whenever ie browser is opened i get this message before navigating to the url i have set.." this is the initial start page for the webdriver server". Is there any way to remove this message.

Thanks
10 years ago
sorry,i didnt get your last sentence..what do you mean by this bears repeating, you do not need it.

If i dont need it then how could i get rid of those errors. please tell
10 years ago
i get this exception when i changed the http://uat to https://www in those generated classes over wsdl http

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
10 years ago
thanks for the quick reply.but why eclipse is not able to locate the wsdl file over https. I tried to change the java file generated over http i.e replace the http://uat with https://www on those generated java files but its throwing errors.

What should i do to fix this
10 years ago
In eclipse i successfully generated a webservice client classes from this wsdl file http://uat.himalremit.com/webService/ws_reg_server.php?wsdl. Everythings works just fine.
But when i change the wsdl file url to https://www.himalremit.com/webService/ws_reg_server.php?wsdl..then in eclipse i get this error "The service definition selected is invalid". Why am i getting this error. How can i generate client classes from https wsdl in eclipse.

Please help
Thanks
10 years ago
I have built a runnable jar application. Its has various jar included inside it. As a result the actual runnable jar size is bigger than my requirement. Can we put the jar files which is included in my application jar(final jar) somewhere else in server and when i run the application jar from client side it should take the reference of the included jar from server. thus saving my space for the application.

What i did is i removed all those jars from my project lib folder and put it somewhere else and again add those jars from eclipse->add external jar option and i made my application runnable jar. but the size is same as before. when i extract it i found all those jars again inside by runnable jar. I m really stuck. Please help
10 years ago
I m using selenium webdriver(internetexplorerdriver). What it does it basically opens a webpage in internetexplorer and does form submitting. Whenever i close the browser(X) manually,the internetexplorer driver is running on the background process.

How to kill that process too as soon as i click close browser(X). please help
10 years ago
I removed all the jars from my project lib folder and add those jars externally. And when i build the runnable jar(export) on my project. The size of the runnable jar remains same..And when i extract it, i see all those jars present inside it.
10 years ago