Wednesday, July 24, 2019

enable dark mode on android chrome ui

Iam using chrome 75 version and below steps enabled darkmode on android chrome ui.

  • copy ‘chrome://flags/#enable-android-night-mode' in the address bar.
  • It will show multiple features for enable/disable/default. For ‘Android Chrome UI dark mode’ select Enabled from dropdown. relaunch browser. 

Thursday, September 11, 2014

Invoking popup box with custom msg

Below is the single line vb script which invoked pop up box with custom msg.


MsgBox "****YOUR CUSTOM MSG, DISPLAYS ON POPUP BOX", vbSystemModal

I use this to notify me to have some water. Genarally we forget to have water at office. So Created a file with is line having msg saying "take some water". Now using crontab(linux)/schedule tax(windows). You can schedule say for every hour. So that you will get popup every hour reminds to have some water...

how to add task to scheduler.
http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/
http://www.7tutorials.com/how-create-task-basic-task-wizard (wizards may varies but you can get idea)

Tuesday, September 9, 2014

Solution: IE webdriver not able to find web elements/ IE driver working very slow while providing input/sendkeys

IE webdriver not able to find web elements:-

From coding side web driver should be initiated as copied below.

DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer\\IEDriverServer.exe");
WebDriver IEDriver = new InternetExplorerDriver(ieCapabilities);
IEDriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
IEDriver.get("https://gmail.com");

If still it doesn't work in addition to above please look into below requirements (copied content from selenium site)

Required Configuration


  • The IEDriverServer exectuable must be downloaded and placed in your PATH.
  • On IE 7 or higher on Windows Vista or Windows 7, you must set the Protected Mode settings for each zone to be the same value. The value can be on or off, as long as it is the same for every zone. To set the Protected Mode settings, choose "Internet Options..." from the Tools menu, and click on the Security tab. For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode".
  • Additionally, "Enhanced Protected Mode" must be disabled for IE 10 and higher. This option is found in the Advanced tab of the Internet Options dialog.
  • The browser zoom level must be set to 100% so that the native mouse events can be set to the correct coordinates.
  • For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates. For 32-bit Windows installations, the key you must examine in the registry editor isHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.


Now web driver should work properly may be sendkey works very slow.

IE driver working very slow while providing input/sendkeys:-
Yeap, it may happen with 64 bit version of IE, try with 32 bit version of IE web driver it should work

Wednesday, October 23, 2013

using expect scripting in perl simple example

Small example is given below. I hope it is self explanatory.
 
#!/usr/bin/perl
use Expect;
my $command = 'ssh';
my $params = ("$Username\@$Server");
my $exp = new Expect;
# Create the Expect object
$exp->spawn($command, $params)
# Wait for Password prompt to show up
$exp->expect($timeout, ["Password:"]);
# Sent the ssh password
$exp->send("$Password\n");
# Wait for command prompt of remote machine
$exp->expect($timeout, ["root\@localhost"]);
$exp->send("ls\r");