Windows 10 tweaks and tricks

Digging deep into Windows 10. Here are some of the most useful windows 10 tweaks and tricks.

  • Use the Hidden Screen Recorder App

Until now, if you wanted to record videos of the apps on your screen, you required a third-party app. However, Windows 10 changes this thanks in part to the new Xbox app. One of the new features of the Xbox app is the Game Bar, which allows not only to record footage of your gameplay but capture footage inside most of your apps as well. Naturally, this hidden functionality to record your apps is quite exciting.

To access the Game bar simply press and hold the Windows and G keys. The Game bar, which is essentially a toolbar, will then pop up on screen. If it’s your first time launching the Game bar for that app, you will get a message asking, “Do you want to open Game bar?”—simply click on “Yes, this is a game.”

windows10_recorder

  • Task view and virtual desktops

This feature was already there for MAC OS and Linux users long ago. Better late than never. Windows 10 now supports virtual desktop out off the box. To get started, click the Task View icon on the taskbar (immediately to the right of the Search box), or hold down the Windows key (abbreviated throughout as Win) and Tab. You can also drag an app to a new virtual desktop by bringing it over to the +New Desktop option at the lower right.

  •  Use Snap Assist for Split-Screen View

This feature helps to open two windows in a perfect split-screen view. To do that, start by dragging the first window to either the left or right edge of your screen. When you release your mouse button, the window will automatically be sized to fit exactly one half of your screen, then Snap Assist will populate the opposite half of your display with thumbnails of any other windows you currently have open.

  • Secret, powerful new Command Prompt tools

Windows 10 packs a new command line features, including the ability to copy and paste inside the command prompt with Crtl + C and Crtl + V.

To activate the goodies, open the command prompt. Right-click its title bar, then select Properties. You can find and enable the new features under the “Edit Options” section of the Options tab.

Note: Ctr+X will not work

  • GodMode

The legendary GodMode, a hidden staple for Windows power users, returns in windows10. As before, activating it unveils a power user menu that brings together all of your system’s far-flung settings and configuration options into a single location. Just create a new folder and rename it to following:

GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

Don’t forget the period after “GodMode”, and you can rename the “GodMode” portion whatever you’d like if you want another name for the folder.

GodMode

 

How to enable Dark Mode in windows 10?

Steps to Enable Dark Mode in windows 10

Microsoft has introduced a dark theme option for the new Edge browser in Windows10 is looks great.
Enable Dark mode for Edge

 

As of now it is only available for Edge browser. But there is a simple tweak to enable dark mode for Windows 10. Following are the steps to do that.

Step 1: Launch the registry editor

Run the command regedit in run window or type it in search window and select it to open.

Step2: Access the correct value as mentioned below.

HKEY_CURRENT_USER -> SOFTWARE -> Microsoft -> Windows -> CurrentVersion -> Themes -> Personalize

Step3: Add a new item of type DWORD(32) value.

Add a new value of type DWORD(32) and rename it to  “AppsUseLightTheme,”. Keep the default value set to 0.

Enable dark mode - Regedit Personalize

Step:4 Logout/restart the system.

You are now done.

Note: Updating registry is not recommended. Try at your own risk.

How To Make WiFi Tethering in Windows 8.1

Steps to Configure Wifi Tethering in Windows:

  1. Launch an elevated command prompt under Windows 8 (command prompt with administrator privileges).
    To do this Press Windows + x key in windows 8 and click Command Prompt (Admin).
  2. Execute the below command to verify that your network interface support virtualization:

netsh wlan show drivers

If the “Hosted network supported” says “Yes“, then you’re ready to share the internet via Wi-Fi. Otherwise, you need to upgrade your hardware, if the software update doesn’t fix it.

  1. Now set up the Ad-hoc wireless network (wifi tethering) using this command. Replace the parts in markup tags with your own choices

netsh wlan set hostednetwork mode=allow ssid= key=

ssid is nothing but your desired Wi-Fi name, you can give your own.

Key is nothing but your Wi-Fi password. It should be Minimum 8 characters long.

Eg : netsh wlan set hostednetwork mode=allow ssid=myhomenet key=012345678

  1. Your hosted network has been created. Now, you need to start it.
    Use the command below to start your Wi-Fi Network:

netsh wlan start hostednetwork

cmd_hosted_network1

  1. Now type exit. Command Prompt will close.
  2. Open the connected network and right click on it and select “Connection Properties“. Now open Sharing Tab (Internet Connection Sharing) and check “Allow other network option”and from the dropdown select the “Local Area Connection”and Click “OK”.

connection_properties

  1. To Check the connection, open Control Panel-> Internet and Sharing and there you will see 2 connections one is your internet connection and the other one is Local Area Connection (Which is your WiFi Created)

Selenium Ruby Binding – how ?

Good part of selenium is that the selenium tests can be written in multiple programming languages like c#, Java, Perl, PHP, Ruby etc. I normally hear saying that “This Java project, so we can write tests in Java as well”.  The only advantage I see with this is that you can get help from development team incase you are stuck somewhere. But if you are good at c# or any other language it should not be an hindrance. Test framework will be different that coding framework unless you want to integrate it.

I covered Java and C# in most of my previous posts. Here I will be using Ruby to write the Selenium tests.

 A simple Ruby Test

require "selenium-webdriver"
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://www.google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Hello Selenium WebDriver!"
element.submit

require “selenium-webdriver”  – This is similar to import in Java and using in c#

The above example is without using any Test framework. In Ruby you can use Test Framework as you do with C# ( NUNIT test framework) and Java( JUNIT or TestNG framework).

In Ruby you can use minitest or BDD framework  RSpec or Cucumber

Structure of RSpec test

load File.dirname(__FILE__) + '/test_helper.rb' 
#'describe' marks the a test group
describe "Selenium Ruby Tests" do 
include TestHelper
 # 'it' marks the start of a test case, ends with the matching 'end'
it "Start Chrome" do
 browser = Selenium::WebDriver.for(:chrome) browser.navigate.to(site_url)
 sleep 1
 browser.quit
end
it "Start FireFox" do
browser = Selenium::WebDriver.for(:firefox) browser.navigate.to(site_url)
 sleep 1
 browser.quit
end
it "Start IE" do
 browser = Selenium::WebDriver.for(:ie) browser.navigate.to(site_url)
 sleep 1
 browser.quit
end 
end

For more information on RSPec click here .

How to convert xml to json format?

To Convert XML to JSON format

Consider a situation where in you have data in xml file and want to use it as a input to some other system where in it takes data in the form of JSON. You would require to convert XML to json format.

Below is an example of converting XML file into json file format.

#! /usr/bin/env ruby -rubygems

require 'rubygems'
require 'active_support/all'
require 'json'
json_str = Hash.from_xml(File.open(ARGV[0]).read).to_json
File.open(ARGV[1], 'w+').write json_str

To run the command,

xml-to-json.rb .file1.xml .file_out.json

 

 

Tips to speed up your slow PC

To speed up your slow PC first step should be restart. In fact you should restart the computer before performing any of the below mentioned steps. Its just like the human brain. You need restart when you are tired.

  1. Stop all unused applications
  2. Turn off unneeded Desktop Features that try to make things look better.
  3. Do a shut down/reboot also known as a cold reboot.
  4. Empty the Recycle Bin.
  5. Uninstall all applications that are no longer needed.
  6. Run “Error Checking” on all hard drives.
  7. Run “De-fragment” on all hard drives
  8. Install anti-virus software and keep it current.
  9. Find and Delete Temporary Files.
  10. Set your computer’s energy settings to High Performance.
  11. Clean Up Primary Partition.

Need detail information of any of the step. Do let me know?

 

Daily price updates for your favorite products via email

The prices of products listed on online shopping site like Amazon or Flipkart may vary every single day and here’s a simple Google Docs based solution to help you keep track of these price fluctuations via email.

The tool can track prices of all products listed on various Amazon websites (all Amazon.* country domains are supported) and Flipkart.com (if you are shopping in India).

For details on how to achieve this go to Digital Inspiration(http://www.labnol.org/internet/amazon-price-tracker/28156/)

How to uses SYSMON to Monitor Performance counter?

Monitor performance counter using SYSMON

The following example uses VBScript to add counters whose values are retrieved from the local computer, modifies some of the SYSMON properties that control how the monitor is displayed, and processes the OnCounterAdd event. The example uses the wildcard character (*) to add all instances of the process counter.

Save the bleow code in a HTML page and open in browser.

<HTML> <BODY BGCOLOR=#C0C0C0> <SCRIPT LANGUAGE="VBScript">
Sub Monitor_OnCounterAdded(index) Monitor.Counters.Item(1).Width = 8 End Sub </Script> 
<OBJECT CLASSID="clsid:C4D2D8E0-D1DD-11CE-940F-008029004347" ID="Monitor" HEIGHT=80% WIDTH=100%> 
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
Sub Window_OnLoad On Error Resume Next Monitor.ShowValueBar = False Monitor.ShowHorizontalGrid = True Monitor.Counters.Add("\Process(*)\% Processor Time") Monitor.DisplayType=sysmonLineGraph Monitor.GraphTitle="System Performance Overview" End Sub 
</SCRIPT> 
</BODY> 
</HTML>

Note: You need to enable ActiveX in your browser, to run the html file.

How to Automate UI Testing using Instruments for iOS app

Automate UI Testing using Instruments

An instrument is a powerful tool that can be used to automate UI testing. Instruments can also be used to collect data about the performance and behavior of one or more processes on the system and track that data over time. Although most instruments are geared toward gathering trace data, the User Interface instrument helps automate data collection. With it you can record user events while you gather your trace data. You can use this recording to reliably reproduce the same sequence of events over and over again.

Launching Instruments

Instruments is contained within the Xcode 4 toolset. Download Xcode from the App Store and install it onto your computer. After you have installed Xcode, you are ready to run Instruments. Instruments can be launched in one of three ways.

To run Instruments from Xcode

  1. Open Xcode.
  2. Choose Xcode > Open Developer Tool > Instruments.

Instruments_1

Even though each instrument is different, there is one general workflow when collecting information from your app. This workflow is a four-step process.

  1. Choose a trace template
  2. Direct Instruments to your app
  3. Collect information from about your app
  4. Examine the collected information

For UI automation we will be using  Automation template in Instruments to execute scripts. An important benefit of the Automation instrument is that you can use it with other instruments to perform sophisticated tests such as tracking down memory leaks and isolating causes of performance problems.

Note: The Automation instrument only works with apps that have been code signed with a development provisioning profile. Apps signed with a distribution provisioning profile cannot be automated with the UI Automation programming interface.

Writing an automation test script

In instruments we use JavaScript for writing test scripts. To create a script

  1. Select the Automation trace template.
  2. Click Add > Create.
  3. Double-click New Script to change the name of the script.
  4. In the Detail pane, select Console to enter the code for your script.
  5. Choose a target for your script.
  6. Click the Play button at the bottom of the Console.

tracetemplate

Selecting trace template

Instruments_3

After you create the script, it can be used throughout the development of your app. You can do this by importing your saved script and running it with the Automation instrument.

To import a previously saved script

  1. Select the Automation trace template.
  2. Click Add > Import.
  3. Navigate to your saved script file and click Open

Accessing and Manipulating UI Elements

To perform an action on an element in your app, you explicitly identify that element in terms of the app’s element hierarchy. Each accessible element is inherited from the base element, UIAElement. Every element can contain zero or more other elements. Script can access individual elements by their position within the element hierarchy. However, you can assign a unique name to each element by setting the label attribute and making sure Accessibility is selected in Interface Builder for the control represented by that element.

 

The four properties used in the scripts to access elements are

  • name. Derived from the accessibility label
  • value. The current value of the control, for example, the text in a text field
  • elements. Any child elements contained within the current element, for example, the cells in a table view
  • parent. The element that contains the current element

 

How to install Cucumber on Mac?

You want to install Cucumber on your mac machine. Or if you are having trouble installing Cucumber and waitr or selenium-webdriver then you are at the right place.

Following are the steps you need to follow in order to install cucumber with waitr/selenium-webdriver.

Step 1 – Install RVM and Ruby

curl -L get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm 
$ rvm list known 
$rvm install 1.9.3 
# This installs Ruby 1.9.3

Step 2 – Install the required gems

Execute:

gem update --system 
gem install rspec --no-ri --no-rdoc 
gem install watir-webdriver --no-ri --no-rdoc 
gem install cucumber --no-ri --no-rdoc

Note:

watir-webdriver requires selenium webdriver, so that one will be installed always. If you only want selenium-webdriver, just do gem install selenium-webdriver instead.

When creating an install_gems.sh file inlcuding these commands, e.g: gem update –system

Note: You need to have Xcode and Git already installed.

For details on using Cucumber refer the following url: https://github.com/cucumber/cucumber/wiki