Simple Code with Selenium C#

Here’s a short but sweet article on using C# with Selenium.

by Karthik KK

The author is easy to read and apply his approaches.


Simple Code with Selenium C#

In this post we will discuss writing some simple code with Selenium C# in Visual Studio IDE. In the last post we referenced our Selenium WebDriver and Chrome driver via Nuget package manager in our project. Please read my previous post to get started with selenium referencing in Visual Studio IDE.

Once you are done with setup (referencing), you are all set you write a simple code.

Here is the code snippet:

  1. “//Create the reference for our browser
  2. IWebDriver driver = new ChromeDriver();
  3. //Navigate to google page
  4. driver.Navigate().GoToUrl(“http:www.google.com”);
  5. //Find the Search text box UI Element
  6. IWebElement element = driver.FindElement(By.Name(“q”));
  7. //Perform Ops
  8. element.SendKeys(“executeautomation”);
  9. //Close the browser
  10. driver.Close();”In the above code snippet, we have

Created an instance for IWebDriver and got the instance for ChromeDriver
Navigate to Google home page
Found the Search textbox of google home page
Searched for execute automation by typing the text
Close the driver instance (which closes the chrome browser)

Here is the complete video for the above explanation

Video 1 – Introduction
Intro to Selenium with C#
(NOTE: There are 3 more videos following this intro. All Good! Webmaster-Bill)

Thanks for watching the video and reading the post !!

Please leave your comments and let me know if there is anything need to be improved in the post !!!

Thanks,
Karthik KK

 

Advertisements

Want To Start a Testing / Delivery Practice?

cropped-qa2100_gravatar.pngSo many of us do.  However, looking at starting something like this from scratch, is truly starting a new business and requires much thought, planning and many “hats”.  Here are some points I have used to assist others in grasping the needed vision, depth of effort, types of talent, and sustainability of the effort that will be required.

Visit my Linked In group at:  QA 2100 Testing: Financial Services

Roles and Resources
It requires full time attention to each of these Roles and Resources:
1.  Experienced and Qualified Prospecting and Sales force
2.  Pre-Sales Preparation, RFP/RFI Replies, as well as Attendance at Presentation (Orals) – for each opportunity.
3.  Attained Status as Preferred Vendor, or Vendor
a.  Requires relationship with Client Companies
b.  Requires meeting their criteria for becoming a vendor
1.  Capacity to perform
2.  Liability Insurance
3.  Fiduciary Responsibility
4.  Legal Compliance
4. Developers for the domains you wish to pursue, with the appropriate skill sets, and experience
5. Business Analysts and Business Architects for the domains you wish to pursue, with the appropriate skill sets, and experience
6.  QA Leaders, Managers, and Testers with domain experience
7.  Project / Engagement / Delivery Managers to connect with the Client and the Teams
8.  Financial Resources to sustain the ramp-up of business, infrastructure, and delivery of services
9.  Financial Resources to sustain Market Research, Marketing Strategies
10.Partnership Alliances – to give you value added leverage when positioning for new business
11.Budget that will include all the above, balanced with enough sales to justify the effort, or a plan for ROI over 5 years for investors.
12.Business plan and road-map that demonstrates all the above, and it’s veracity.
13.Staff on the ground – available, ready to work on-site, near-shore, no visa issues, or proven offshore teams that have a solid delivery history.

I am writing this not to discourage those interested in pursuing such a goal, rather to create curiosity and and interest in taking on the challenge.   These concepts and work efforts are real elements that have to be in place before it can be a successful venture…. even for an established company wanting to build a new practice.

Business Plans:
In other words, this effort requires at least:
Experts to Initiate, Drive and Deliver
Business Concept(s) meeting Market needs; Business Need/Justifications
Planning: Initial Steps to Initiate, Milestones at 3 mo., 6 mo., 1 yr, 18 mos., 2 yrs., etc. till 5 years
Identified Services and Products
Multi-Phase Financing: Start-Up Money, Mid-Term Money, Long-Term Money, Planned ROI’s for each phase
Market Research for Service / Product Viability,
Strategy for Launching the Business,
Scope of Ramp-up,
Planned New Business Market(s)
Planned Costs
Ability to Staff and Deliver
Motivation, Determination, Desire, Mission and Purpose
Commitment to see it through

None of these comes pre-packaged, or comes easily.  It all requires vision, leadership, experience, clarity, strategy, good communication, follow through.

I am certainly not giving away the store here, but sharing some thought work I have used to help prepare business not only in the IT world, but as part of my 12 yrs of Management Consulting before my last 19 years in the IT business!  These principles hold true in any enterprise!  I have written many accurate and successful business plans for new or international or established companies seeking investment money to fund a start-up.

As a thought leader and architect of Quality Assurance, and Business Process, I have learned through experience these tenets, which will not be learned so much at school, but by living it and delivering it – with successful outcomes.  That does not mean there weren’t failures, or massive challenges along the way – that is where the real learning takes place.

The Insapience of Anti-Automationism – Context Driven Testing

Wow! That is a mouthful, but well worth reading in this great and stirring article on Context Driven Testing by Cem Kaner   http://context-driven-testing.com/?p=69

This is an outstanding article on the DISTINCTIONS and False Dichotomies that need to be clarified and observed when planning and writing test cases: manual vs automated,  checking vs testing …. or ‘sapient’ (is this a new test term or is it an attempt to marketize a concept?)

“…According to the ?new doctrine?, only manual testing can be sapient. Automated tests are done by machines and machines are not sapient. Therefore, automated testing cannot be sapient. Therefore, if a tester is enthusiastic about sapient testing (whatever that is), automated testing probably won’t be of much interest to them.”

Hmmmm……

It also Invites ond, as Ron Jeffries puts it in the comments:   “…to look at the question from different angles, and the message that I get is that there is no bright line anywhere to be seen. That matches my deepest intuitions and gives me a kind of comfort.”

 

Security in 2015 – What measures will be implemented to improve it?

by ,  Sr. Quality Strategy and Delivery Advisor

Is Security in your environment covered?

  • Do you have a full rundown/analysis of the gaps you may have in your system?
  • Have you created a checklist of all:

    • touchpoints
    • protocols
    • profiles
    • methods of transmission
    • firewalls
    • frequency of sweeps
    • frequency of security monitoring status reports?
    • Do you have a network ops monitoring application?

imageThis is not the year to be avoiding the security risks afoot … not only from your own employees, random local hacker, but serious international hacking as pro-active attacks on your system. 2014 demonstrated an increase in security leaks – or might i say exposure of weak security by upstream hackers with malicious intent. Expect more of it. Breaches have been happening every year for some time. We are no longer surprised by them. It is another overload of input that we as consumers can do little to prevent.

Prevention of security leaks are up to those responsible for maintaining our private accounts and data. That they have allowed weaknesses that are gaps, and hackable, is irresponsible, unacceptable, and once leaked causes much damage financially, and personally.

What is a Threat Agent?

The term Threat Agent is used to indicate an individual or group that can manifest a threat. It is fundamental to identify who would want to exploit the assets of a company, and how they might use them against the company.  You can read more about it here:
https://www.owasp.org/index.php/Category:Threat_Agent

Here are some Highlights from Open Web Application Security Project “Attacks” references:
https://www.owasp.org/index.php/Category:Attack

Looking forward to seeing deeper security measures, and fewer assailable gaps by our financial institutions and retailers.

All comments invited.

Lack of Integrity and Moral Grounding causes breach in security for Morgan-Stanley and others

PCWorldNews-LOGO Morgan Stanley fires employee who leaked sensitive client data

By now, this is old news. by 2 days. And this is not the first or the last time…

BUT, the issue is: how to contain actions of rogue employees, who for one reason or another choose to leak data to create either fraud, embezzlement, or just outright malicious damage.

-or-

Change the hiring and training of those with deep security access.

Here is another case of actions taken by people who lack integrity or the moral certitude (to prevent them from such) that cause the rest of us to suffer either through monetary loss, or tighter security – both are reactionary, after the fact, and hard to recover…

IMG_3144Solutions? Creating higher level, invisible, security barriers around known system security? Improving morale? Creating behavioral awareness that is alert to potential disgruntled behavior? Or creating a higher standard of integrity for those with deep security access? Better background screening?

Return to integrity anyone?

Testing Is An Art And A Science

Leading a Test Project, for me is like conducting an orchestra! I love this metaphor as an overlay to the best practices of setting up, developing test phases, cycles, tests, executing the test environment and ultimately launching a product.

Sections of woodwinds, strings, horns, percussion, pianos, harps – can be likened to systems with many lines of functionality, processes and stages of preparation before the final Live Performance. Each system requires it’s own notation, dynamics and coordination with all the other systems to deliver the Theme.
System Integrations (Section Rehearsals) must be completed before the End To End (Full Rehearsal) can be fully performed, and Dress Rehearsals are the UAT when the last minute updates to the Score (Test Cases, and Process Flows) get penciled in.

It is the art of planning, coordination, testing the same components again and again until the kinks are worked out with developers, and seeing all the working parts come together as a final product that brings a deep sense of satisfaction to all the teams participating in the launch.

The art and science of Testing is very much like the Art and Science of composing and playing music. Having studied Composition and Theory in College, and years of professional performance, I never dreamed I would one day be conceiving Test Strategies and Test Plans, leading Technical Testing projects – some lasting several years. I believe learning to conceive and produce a musical piece from beginning to end – has allowed my approach in understanding and alignment of systems, dynamics, specific ranges of capabilities for each component – come together into a symphony of functional processes that deliver a final outcome desired by the Client.

Even IBM has done studies on the compatibilities between music and IT, and has noted that many formally trained musicians gravitate and succeed in the complex technical world of development and testing. I feel this approach, while creative, is also formed by the formal training and experiences in Quality Assurance and Testing best practices. In any event, Music and Quality Assurance are disciplines that require years of study, practice and dedication to fully mature into a well rounded and competent delivery process.

I wouldn’t have it any other way!