Forum Discussion
I upgraded to latest version (i.e. 12.10.602.7 ).
I found 3 new isseus as below,
- I deleted browser cache, history and everything. Then I tried to execute the same it is still showing same kind of error with ‘IExplorer’. If I write the same code for Chrome browser it is working as expected(Closes existing browser and opens new). Also I am not able to use run methods(Run/Navigate etc.) for Chrome browser. It is saying unable to navigate null ‘url’, though I am passing it in the method itself.
- I am able to achieve ‘Closing of Browser(if already open) and launching a new browser’ with below code. [Fails if no browser is open.] In the example This line is not getting executed until we run it in debug mode-> “ Browsers.Item("iexplore").Run();” [Whenever 2nd mentioned scripts in debug mode(i.e. step by step execution using ‘F10’ key) It works well with both the situations opened browser and closed browser.]
- Also able to achieve ‘Launching a new window(if browser is closed)’ with below code [Fails if browser is already open.]
Attached are the screenshots for more understanding.
I'm confused?!?!?
In your initial post, I'm in agreement with tristaanogre, it looks like the hook into IE is broken/corrupted/missing.
But in your second post ..... I'm not sure whats going on?
Screenshot 1 - Chrome - You close Chrome then try and navigate to page on it? That's not going to work! (Log and code both show this)
Screenshot 2 - IE - Not sure what's happening here. It looks like the "Run" method didn't work on your browser object? I just tried it and it worked fine.
Screenshot 3 - IE - Suggests it isn't killing the process properly. Which may mean you have two IE processes present. Which will cause problems if one is hidden. I thought this might be the case with screenshot 2, but the log for that said no IE process found ...
Ahhhhh! Hang on. On screenshot 2, it says it didn't kill the process as it couldn't find the window. Are you sure you don't have a second (invisible) IE process floating around in the background during all this?
Beyond that guess, I'm not sure what's happening here ....
- tristaanogre8 years agoEsteemed Contributor
Something else I noticed... you're using it a appears to be either JScript or JavaScript and you're calling Navigate("http:\\smartbear.com")
First of all, proper URL's use the "slash" not the "backslash" so it should be as Navigate("http://smartbear.com"). However, most browsers are "smart" enough to autocorrect to the correct slash.
If, however, you ARE going to use backslash, because you are using JScript/JavaScript, the "backslash" character in JavaScript strings is used for special codes. So, anytime you want it to "print", you actually need to double it up.
So, make sure you're URL's look like Navigate("http:\\\\smartbear.com\\") in order to properly send the correct characters.
Other than that... yeah, as Colin_McCrae points out your log shows what your code is doing, that you're closing the browser and THEN calling the "Navigate" function. If you are closing the browser, you need to make sure that you either re-open it or, instead of Navigate use "Run". So, your code would be,Browsers(btChrome).Run(url);
- kjadhavkunal8 years agoContributor
How should I kill the process of 'iexplorer.exe' through script ? Please provide me a solution on this.
What I realised is, it remains in running state even after I close the browser using Sys.Browser().Close(); this script.
- where 'Browser' is parent class object of this process.
I checked in Task manager -> Processes -> 'iexplorer.exe'
- Colin_McCrae8 years agoCommunity Hero
Terminate it.
It's a standard method of all processes, including browsers. It should come up in code complete! Not hard to find ...
- kjadhavkunal8 years agoContributor
I am using following code to kill process,
var process = Sys.WaitProcess("iexplore", 5000);
if (process.Exists)
{
process.Terminate();
}
And its giving me following attached error
Related Content
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago