Watir-webdriver with firefox - watir-webdriver

I'm working on web-application automation using ruby and ruby's framework watir-webdriver with Firefox v20.0.1, when I use file_field function to get the file, it gives the following errors:
Element is not currently visible and so may not be interacted with
(Selenium::WebDriver::Error::ElementNotVisibleError)
Before, I was running same code with Firefox profile is 'default' that time working fine,
and now I changed the Firefox profile is 'new' and getting these errors. Moreover I not able to set the Firefox profile to 'default' on v20.0.1.
Whether it is correct way or not, please help me!

have you tried
gem update webdriver
from the command line to ensure you have the latest webdriver code?

Related

Why am I getting an error when loading webviews in VS Code?

I'm using a portable install of VS Code 1.56.1 on Windows 10. Whenever open an extension from the marketplace, I get the following error:
Error loading webview: Error: Could not register service workers: TypeError: Failed to register a ServiceWorker for scope ('vscode-webview://extensioneditor/') with script ('vscode-webview://extensioneditor/service-worker.js?platform=electron&id=extensionEditor&vscode-resource-origin=https%3A%2F%2FextensionEditor.vscode-webview-test.com'): ServiceWorker cannot be started.
Same thing happens for other things using webviews, with a slightly different path (like VS Code release notes). I'm able to install plugins and view the Feature Contributions tab, but I cannot view the Details and Changelog tabs.
Any thoughts on what could be causing this? This is on a managed machine where security settings might be changing. I'm using a portable install because my installed version stopped working out of the blue last week and this was supposed to be the workaround until that was figured out.
I was getting the same error, it looks like an issue introduced on version 1.56.0.
For me the fix was running VS Code without elevated permissions.
I always run as administrator and running without it fixed the issue for me.
I had this problem, in terminal use code . --no-sandbox
Updating python3 to the most recent version may also help.

Eclipse Browser has problems with rest api call

I have a problem with my eclipse browser.
If i call the url of my sonarqube server (https://sonar) everthing works fine and eclipse shows me the page. But if i try to call the api (https://sonar/api/system/status) it returns with an error window which says that the page could not be opened. The same url worked for me in normal browsers.
Question
Does eclipse browser has problems with calling rest apis in general? Or is there something i could do to make it work?
System:
Windows 10 Pro (10.0.15063 Build 15063)
Eclipse Oxygen.1a Release (4.7.1a)
Ok, the problem seems to be in IE (which is used by eclipse in default). If i call the url in IE it wants to download the json answer. I changed some values in registry so IE just show me the json in browser directly. After that also eclipse could show me hte result without error.
Here is my ie_json.reg file i executed to change values in registry:
Windows Registry Editor Version 5.00;
; Tell IE 7,8,9,10 to open JSON documents in the browser on Windows XP and later.
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place" .
;
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=hex:08,00,00,00
I found this solution at http://developers.de/blogs/holger_vetter/archive/2013/12/13/view-json-in-internet-explorer-7-11.aspx

Permission denied to access property "handleEvent"

I'm testing a web app in several browsers with the Selenium 2.45.0 grid.
At one point (I suppose when Bugsnag was added to the app) some find_element functions started to fail in Firefox (still work in Safari) with the 'Permission denied to access property handleEvent error.
It looks like there is a workaround for that:
adding
$driver -> get_active_element();
before calling
$driver -> find_element...
But this is awkward.
Did anyone else face the same problem and find a more adequate solution?
This is fixed by rescuing from this exception in Bugsnag v2.4.8. Arguably selenium shouldn't be adding native handlers to in-page events, but oh well :).
So my suggestion is that error occurs coz of not really good compatipability firefox 37 and selenium server 2.45 I would recommend you trying to install firefox 36 or wait till selenium web driver get update. Because in my case of using selenium 2.45 and firefox 37 it does not work at all - browser just opening and hanging till timeout.

Selenium Webdriver 2 with Firefox 26?

This morning I was running Selenium with 2.32 and Firefox 25.0.1. Firefox updated to 26.0, and suddenly Selenium stopped working. It pops up the new browser window, but then just sits there prompting for a search or address. Is Selenium known to have a problem with this? Is it confused by the new prompt in the Firefox address bar? Has it already been fixed in a newer Selenium 2.3x?
While waiting for a fix, what is the easiest way to change my code to work with either Chrome or (yecch) IE10? I'd like to make my test code configurable so that others in my group can use their browser of choice (especially Chrome). I tried once to get Chrome to work by adding 'browser_name'=>'*chrome' to the new() method, but it never worked.
BTW, I am using the Perl language binding (Selenium::Remote::Driver 0.17).
Try updating selenium to 2.38.0 (latest one at the time of writing). I had something similar problem with firefox updating and then buttons not being clicked and upgrading the version solved it. Hope this solves it.
Update to selenium to 2.39.0 e.g:
<seleniumVersion>2.39.0</seleniumVersion>
I am also facing the same problem after upgrading my selenium to 2.39.0. I couldn’t solve my problem so I switched to Chrome.
Download the Chrome driver and give it the path where you invoke the browser. Then it’s easy in Chrome:
if (config.getProperty("Browser").equals("chrome")) {
System.setProperty("webdriver.chrome.driver", "path of the chromedriver");
dri = new ChromeDriver();
}

Symfony, netbeans 6.8 and debugging a web page

I am using Symfony (1.31) - with Propel ORM to build a website. I have recently moved from using a text editor, to Netbeans (6.8) as my dev environment.
Coming from a compiled language (C++) background, I am used to setting break points in code etc as part of debugging. Web development I have encountered (atleast with PHP), has been largely hit and miss - well debugging has been messy to say the least, using echo statements, logging stuff to file etc. Well I hear that it is possible to debug PHP (i.e. set breakpoints etc).
I have scoured the net for documentation to show how to set breakpoints (say in one of the MVC layesrs) so that when the relevant page(s) is opened via a browser, the breakpoint will get hit and I can step through the code (ideally, watching the program variables).
Is this possible using Symfony and Netbeans 6.8?.
There seems to be support for XDebug: http://netbeans.org/kb/docs/php/debugging.html
If you have specific questions about configuring XDebug: http://wiki.netbeans.org/HowToConfigureXDebug.
More useful articles on PHP development in NetBeans: http://netbeans.org/kb/trails/php.html.
Hope that helps.
UPDATE: Just installed NetBeans 6.8 and ran through the configuration and was able to get breakpoints to work successfully with XDebug. NetBeans' integration with Symfony is pretty slick too, +1 to question for getting me to check this out.
Here is what has helped me debug my Symfony apps:
Enable logging and the web debug toolbar via apps/appname/config/settings.yml. Note: Any changes will require clearing the cache.
dev:
.settings:
web_debug: true
logging_enabled: true
Use var_dump() or print_r() with pre tags to dump data from anywhere. Adding exit; will allow you to dump variables from the controller or anywhere else.
echo '<pre>';
vardump($something);
echo '</pre>';
exit;
Enable logging and log messages. You can access the logger anywhere as well, but make sure you enable logging for your environment:
sfContext::getInstance()->getLogger()->info($message);
I've used Gubed with Quanta+ as a stepping debugger with PHP, don't know if you can get that to work with Netbeans but I thought it was more hassle that it was worth. I found that I could for(i=0;i<~6;i++){dump stuff to screen/log; make changes; reload;} and solve an issue in less time than it took me to step through it once with the debugger.
Xdebug is a very useful PHP extension which features a remote debugger with support for some editors, though Neatbeans isn't listed. I've not used the remote debugging element of Xdebug (see above) but the profiling, code coverage and - in particular - improved browser error messages I find helpful.
Generally with Symfony I find I can get most of what I need from stack traces or by dropping items into the logger and picking them up with either the debug toolbar or firesymfony.
Netbeans 7+ has trouble with xdebug breakpoints in the model/action. You have to use the manual function to set breakpoints.
xdebug_break();