Theme images by Storman. Powered by Blogger.

Software Testing

[best practices][feat1]

Recent

recentposts

Popular

Comments

recentcomments

Most Recent

Random Posts

randomposts

Facebook

page/http://facebook.com/letztest

Thursday, July 28, 2016

How to find Xpaths using WebDriver Element Locator

- No comments
Finding/Writing XPath is one of the greatest challenge that most of the automation testers come across. In this post I am going to introduce a new plugin before you which will help you in finding the right XPaths just by a click.

This plugin generates different xpaths using xpath finding techniques. With the help of this you can easily generate xpaths for C#, Java, Python, Ruby.

For downloading this plugin for Firefox > Navigate to below url:
https://addons.mozilla.org/en-us/firefox/addon/element-locator-for-webdriv/
[Update/ This plugin is deprecated and hence I reccomend to use the below one]

Firefox : https://addons.mozilla.org/en-US/firefox/addon/truepath/

Chrome: https://chrome.google.com/webstore/detail/truepath/mgjhkhhbkkldiihlajcnlfchfcmhipmn 


Once installed, you can navigate to any element and right click on that element which will generate xpath for that particular element. In the below image we have managed to find XPaths for the donate button.



For the new one it looks like this:




Now I am sure that you have got much relief for the question:

How to find XPaths in Selenium :) 

Happy Testing !

Thursday, July 7, 2016

Must Know Visual Studio Keyboard Shortcuts

- No comments


In this post let me give you a short list of keyboard shortcuts for things you probably do often in Visual Studio. Many of them might be using these but still there are some who are not much familiar with using keyboard short cuts while programming.

Visual Studio Keyboard Shortcuts

Editor Related Keyboard Shortcuts

  • Ctrl + Enter   =   Insert blank line above the current line.
  • Ctrl + Shift + Enter   =   Insert blank line below the current line.
  • Ctrl + Space   =   Autocomplete using IntelliSense.
  • Alt +Shift +arrow keys(,,,  =  Select custom part of the code.
  • Ctrl + }   =   Match curly braces, brackets.
  • Ctrl + Shift + }   =   Select text between matched braces, brackets.
  • Ctrl + Shift + S   =   Saves all files and projects.
  • Ctrl + K, Ctrl + C   =   Comments the selected lines.
  • Ctrl + K, Ctrl + U   =   Uncomments the selected lines.
  • Ctrl + K, Ctrl + D   =   Do proper alignment of all the code.
  • Shift + End   =   Select the entire line from start to end.
  • Shift + Home   =   Select the entire line from end to start.
  • Ctrl + Delete   =   Deletes the word to the right of the cursor.

Debugging Related Keyboard Shortcuts

  • Ctrl + Alt + P   =   Attach to process.
  • F10   =   Debug step over.
  • F5   =   Start debugging.
  • Shift + F5   =   Stop debugging.
  • Ctrl + Alt + Q   =   Add quick watch.
  • F9   =   Set or remove a breakpoint.

Search Related Keyboard Shortcuts

  • Ctrl + K Ctrl + K   =   Bookmark the current line.
  • Ctrl + K Ctrl + N   =   Navigates to next bookmark.
  • Ctrl + .   =   If you type in a class name like Collection<string> and do not have the proper namespace import then this shortcut combination will automatically insert the import.
  • Ctrl + Shift + F   =   Find in Files.
  • Shift + F12   =   Find all references.
  • Ctrl + F   =   Displays the Find Dialog.
  • Ctrl + H   =   Displays the Replace Dialog.
  • Ctrl + G   =   Jumps to the line number or go to the line.
  • Ctrl + Shift + F   =   Find the references of the selected item in the entire solution.

Navigation Related Keyboard Shortcuts

  • Ctrl + Up/Down   =   Scrolls the window without moving the cursor.
  • Ctrl + –   =   Take cursor to its previous location.
  • Ctrl + +   =   Take cursor to its next location.
  • F12   =   Go to definition.

Project Related Keyboard Shortcuts

  • Ctrl + Shift + B   =   Build your project.
  • Ctrl + Alt + L   =   Shows Solution Explorer.
  • Shift + Alt + C   =   Add new class.
  • Shift + Alt + A   =   Add new item to project.
You can go through the complete list of shortcuts here

Tuesday, July 5, 2016

How to find all links on a web page using selenium webdriver C#

- No comments


Sometimes we may need to find some tricky actions on software web applications. Selenium webdriver do not have any direct method to perform any such tricky actions. So we may need to use some tricks in our webdriver test script to enable us to perform some actions on the required web applications. Today let's discuss about how to find all links on a page using selenium webdriver C#

You can use the following method to find all links on a page using selenium webdriver C#

Below is the code which finds all the links on a webpage. We are navigating to a link using Firefox. Next we get all "A" tags using FindElements and iterating through those using ForEach loop.