Skip to main content

Posts

Showing posts from October, 2012

Verifying what we typing into "input" element

For example: we have such element in web page: < input id=" input1 " class="timeField" type =" text " /> WebElement element = driver.findElement(By.cssSelector(".timeField")); String textToInput = "English"; //we can easily read its' initial value by: String initalText = element.getText(); //but if you type something and try to get text you will get empty string //removing initial value in "input" element.clear(); // typing "Eng" element.sendKeys(textToInput.substring(0,3)); // text == "" - empty string String text = element.getText(); // correct way to check text(value) in input element: //text == "Eng" text = element.getAttribute("value"); //typing "lish" element.sendKeys(textToInput.substring(3)); // text == "" - empty string text = element.getText(); // text = "English" text = element.getAttribute("value");

"The Jenkins service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."

Jenkins cannot start using "Services" tool (Control Panel -> Administrative tools -> Services) Solution: remove logs from "Event Viewer" (Control Panel -> Administrative tools -> Event Viewer) Right click at "Application" in the left panel  and click "Clear all logs" or "Clear logs"

Ubuntu One doesn't synchronize my files

I have Ubuntu 10.04 LTS, wicd instead of NetworkManager. Ubuntu One has status "Synchrnization in progress..." and that's it no files are synced. in ~/.cache/ubuntuone/log there is files like syncdaemon-exceptions.log.* open last one and get errors mine has two lines: 2012-05-16 19:17:34,311 - dbus.proxies - ERROR - Introspect error on org.freedesktop.NetworkManager:/org/freedesktop/NetworkManager: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files 2012-05-16 19:17:34,347 - ubuntuone.SyncDaemon.DBus - ERROR - Error while getting the NetworkManager state org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files Found simple solution for this problem:  Open System Monitor: "System" -> "Administration" -> "System Monitor": Kill\End next processes : ubuntuone-logi

Screen capturing with vlc and python

Here is simple code: i = vlc.Instance() player = vlc.libvlc_media_player_new(i) m = i.media_new("screen://", ":screen-fps=24", ":sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:file{dst=screencapture.mp4}", ":sout-keep") player.set_media(m) player.play() time.sleep(10) player.stop() i.release() You will need installed vlc and vlc.py module. more info: http://wiki.videolan.org/Python_bindings http://wiki.videolan.org/