Do you have your own test framework? What are it's capabilities? Share ideas/thoughts/experience/etc.

225 views
Skip to first unread message

Scal

unread,
May 4, 2011, 2:58:14 PM5/4/11
to Selenium Users
Hi;
I am wondering who in the community (at least in the Google groups)
has build it's own test framework for Selenium (whatever version /
language)?
By framework, I mean to be able to dynamically populate either:
- test data
- commands

I have been testing for the past 3 years with a pretty simple test
approach, which was:
- define test cases
- code them (in java)
- implement them into a repository
- run them through a CIS (Bamboo, Hudson/Jenkins, ..)

I have now started a new job for almost a month and my requirements
were to be able to parametrize test case "templates".
The original idea was to have hard coded methods with a specific flow
and pass any data set to make it available for any site implementing
the same flow. This is kind of data driven testing.
The scope changed a bit and I ended up, after 3 weeks so far, to build
(still in java):
- a complete database structure that looks like this:
+ projects
+ --- test suite(s)
+ ------ test cases(s)
+ --------- action(s) with default parameter value
+ ------------ action parameter per browser (optional)
+ browsers
+ logs

With this design, I can create a project that has one or more test
suite which itself can contain one or more test case, which itself can
contain one or more action. Each action's (selenium command) arguments
(target and value) can be set per specific browser. So if a default
xpath can't be resolved with IE, I can set a specific one that it can
use.
Each project can be associated to a specific browser (ones available
in Selenium GRID), and test suites/cases and actions can be "attached"
to any project. A project can be a "clone" of another, with the only
difference to be the browser to put the project to test under.

I also implemented direct Selenium IDE (html format) import and export
directly into the DB to populate the test cases and actions database
tables. The export can be used to build the file and use it in
Selenium IDE again.

I'm currently implementing a screen-shot comparison feature (as a
simple extra action) too.

My next goals for this framework are:
- use Java's Robot class to be able to send mouse/keyboard commands.
This could be useful to interact with something else than just the DOM
that Se 1 (version I use) allows. For example, going into the
browser's menu (File, Edit, View, ..) items, click the "view image"
when doing a right click on one, etc.
- find a way to test flash/flex without having to modify the .swf file
for Selenium to be able to interact with.
- build a custom website (with a user/permission management module) to
manage the projects people would be assigned to. This would also
present the reports being build based on logs I do for all actions/
test case/suites of projects of the framework itself.

This is of course something really big to build but allows a total
control of the tests to perform on different systems (websites)
without coding anything anymore. Something you would more likely not
build for a "regular" website, but more for a company that has many
different websites being build/maintained/upgraded/etc. I'm think of
web agencies or big corporations.

So, what do you, as tester, do? What is your way of testing?
I'd love to hear what solution you either use or have build yourself
(or other developers/testers in the company you work for) and what you
think of such solution I'm implementing.

Thanks for reading and sharing :)
Cheers;

Andy Tinkham

unread,
May 4, 2011, 3:53:35 PM5/4/11
to seleniu...@googlegroups.com
I think you have some interesting ideas in there. I don't know that this architecture would work in my environment, but it sounds like it works well for what you're doing (and you said it was geared more towards a place building out multiple web sites, which is definitely not my environment). If it were me, I'd be a little concerned about cloning projects and then having changes made in only one project and not its clones, but maybe you have mechanisms for dealing with that, or you don't often make changes to an older project. It does sound like you've got a good separation between the data, the details of the app, and the test framework, which I think is a key piece, and I'm glad to see you have it. It seems like when maintenance is needed for your suite, you know where the changes should be made, and aren't generally changing things throughout the entire range of code.

Here's how my suite is structured:

* Cucumber feature files -- plain text, business-focused scenarios. These scenarios specify their data needs in generic terms rather than specifying particular records (so, "a patient with no allergies" instead of "Smith, John (ID #28937490)". The tests are written so that they specify the minimum amount of information needed to successfully complete the test for both actions and data, so that we get natural variation in our tests rather than trodding the same ruts over and over every time. Cucumber uses regular expressions to map the plain text clauses to function calls in the:
* Conceptual Model of my system -- This model focuses on the concepts in the system. These are the things that would make sense to anyone who has experience working in hospitals, but has never seen our system (or any electronic health record system for that matter). It's completely ignorant of the implementation of our system. The methods in this model are what the cucumber clauses call. These methods then take the data requirements sent in by cucumber and find (or create, if necessary, though usually it shouldn't be) a suitable record. Each conceptual model method corresponds to some task that a user would use as they described what they needed a system to do (admit a patient, administer an IV, add a vital signs reading). These tasks get broken down into a series of subtasks. These subtasks are packaged up with the data and sent off to the:
* Implementation Model of my system -- This model receives the commands from the conceptual layer. In my system, I currently have 5 web app components that may or may not be installed, and 30-some client/server apps (the old system). The top of the implementation model finds all the platform models (web and client/server) and loads them. Each platform model finds its underlying application models and loads them, and each application model finds its associated page or screen objects and loads them. Each time a command comes in, requests are sent down through the models to see which page/screen objects can handle the command. One of the objects that can handle it is then chosen and given the command. There's a filtering mechanism built into the commands so we can restrict a command to a certain application if we need to, but most of the time, we want that variation again. (With all this variation, there's a log being kept that gives us executable scenarios for when we need to exactly repeat a run). This model isolates the above layers from knowing what particular combination of web apps and client-server apps are installed on the system. If there's any way to execute the passed-in command given what's installed, it will happen. If we're in an environment that doesn't have any way to achieve the command, my goal is to have Cucumber skip the scenario (and flag it as skipped rather than failed).

The page objects are defined in terms of control objects which wrap each control type we interact with on a page - so there's a class for EditBox and one for Hyperlink and so on. These classes wrap the bulk of the selenium calls, though there are places where the page objects call selenium directly too. I also have Ruby modules which are included in classes to define common UI elements (either as individual controls or as a class representing a common element that appears on multiple pages and is itself composed of other controls (again either individual or composite)).

Verification is sprinkled throughout the levels - a control object may just verify that its value is set correctly, while a page object may verify that the entire command it received was processed correctly. The conceptual model may then verify that the entire task is completed correctly, and the test cases themselves specify verification of the entire scenario.

Everything is built in Ruby. Pieces I have coming up (besides actually finishing implementing all of the above) are the addition of a random test driver that uses Ruby metaprogramming to get the conceptual model methods and then strings them together in random order for extended test runs looking for interaction bugs for which we haven't yet planned specific test cases. I've got some screenshot taking code and need to hook that up on failure. Over time, I also want to build out more options for achieving the same thing using different paths. Using the platform/application models inside the implementation model already gives me some of my desired behavior manager (so for example, if I needed to get text to the clipboard for some reason, I could select the text and press Ctrl-C, select the text and then choose Copy off the Edit menu, or choose Copy off the context menu, or maybe click a toolbar button. The behavior manager knows all 4 of those options and then picks one each time it needs to get text to the clipboard. Smarter behavior managers might enforce order ("I chose #2 last time, so I'll choose #3 this time, and #4 next time") to get coverage, but even ones that just pick randomly each time should provide better coverage over multiple test runs). Initially, most things will have a single path as we build out for breadth first, but we'll add some of these other paths as we go.

I also want to add some basic performance measuring and security testing to the tests. Neither of these will go all that deep, but they'll give us some basic checks. I need to also get the tests running headless and hook them up to our CI server, with scheduled nightly runs in the various browsers. Parallelization is also high on my list. Finally, I'd like to build in some of the usability testing that Julian Harty talks about on blog.bettersoftwaretesting.com

Andy

-----Original Message-----
From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Scal
Sent: Wednesday, May 04, 2011 1:58 PM
To: Selenium Users
Subject: [selenium-users] Do you have your own test framework? What are it's capabilities? Share ideas/thoughts/experience/etc.

Hi;
I am wondering who in the community (at least in the Google groups) has build it's own test framework for Selenium (whatever version / language)?
By framework, I mean to be able to dynamically populate either:
- test data
- commands

I have been testing for the past 3 years with a pretty simple test approach, which was:
- define test cases
- code them (in java)
- implement them into a repository
- run them through a CIS (Bamboo, Hudson/Jenkins, ..)

I have now started a new job for almost a month and my requirements were to be able to parametrize test case "templates".
The original idea was to have hard coded methods with a specific flow and pass any data set to make it available for any site implementing the same flow. This is kind of data driven testing.
The scope changed a bit and I ended up, after 3 weeks so far, to build (still in java):
- a complete database structure that looks like this:
+ projects
+ --- test suite(s)
+ ------ test cases(s)
+ --------- action(s) with default parameter value

+ ------------ action parameter per browser (optional) browsers logs

With this design, I can create a project that has one or more test suite which itself can contain one or more test case, which itself can contain one or more action. Each action's (selenium command) arguments (target and value) can be set per specific browser. So if a default xpath can't be resolved with IE, I can set a specific one that it can use.
Each project can be associated to a specific browser (ones available in Selenium GRID), and test suites/cases and actions can be "attached"
to any project. A project can be a "clone" of another, with the only difference to be the browser to put the project to test under.

I also implemented direct Selenium IDE (html format) import and export directly into the DB to populate the test cases and actions database tables. The export can be used to build the file and use it in Selenium IDE again.

I'm currently implementing a screen-shot comparison feature (as a simple extra action) too.

My next goals for this framework are:
- use Java's Robot class to be able to send mouse/keyboard commands.
This could be useful to interact with something else than just the DOM that Se 1 (version I use) allows. For example, going into the browser's menu (File, Edit, View, ..) items, click the "view image"
when doing a right click on one, etc.
- find a way to test flash/flex without having to modify the .swf file for Selenium to be able to interact with.
- build a custom website (with a user/permission management module) to manage the projects people would be assigned to. This would also present the reports being build based on logs I do for all actions/ test case/suites of projects of the framework itself.

This is of course something really big to build but allows a total control of the tests to perform on different systems (websites) without coding anything anymore. Something you would more likely not build for a "regular" website, but more for a company that has many different websites being build/maintained/upgraded/etc. I'm think of web agencies or big corporations.

So, what do you, as tester, do? What is your way of testing?
I'd love to hear what solution you either use or have build yourself (or other developers/testers in the company you work for) and what you think of such solution I'm implementing.

Thanks for reading and sharing :)
Cheers;

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Scal

unread,
May 4, 2011, 4:59:46 PM5/4/11
to Selenium Users
Hi Andy;
thanks for the reply!

On May 4, 9:53 pm, Andy Tinkham <andy.tink...@healthland.com> wrote:
> If it were me, I'd be a little concerned about cloning projects and then having changes made in only one project and not its clones, but maybe you have mechanisms for dealing with that, or you don't often make changes to an older project.
A clone is project, is an exact same copy of an existing plan with
property difference(s) for the plan itself; like the base URL.
Basically, every item (project, test suite, test case) can be a real
copy that you can edit without affecting other project using the same
item OR a "reference copy" for which changes (at test suite / test
case level) would impact all projects using them. That is the desired
purpose to not have to update a test case for a same feature over
different base URL (like DEV, STAGING and PROD). 
> It does sound like you've got a good separation between the data, the details of the app, and the test framework, which I think is a key piece, and I'm glad to see you have it.
Thanks, I appreciate that.

> * Cucumber feature files --
This Cucumber thing sounds very good, but I guess my approach of
testing, with my background developer, doesn't fit my way of thinking.
I've been looking into it in the past and never could really see why I
would use that, even though I really do understand the principle of
"human readable" test case definition. Specially when you have people
not involved in technical aspect of the test to do or run.

> The page objects ...
That sounds nice, is it something you could easily see in use in other
projects that you currently work on or kinda specific to the company's
business/application needs?

> Everything is built in Ruby... so for example, if I needed to get
text to the clipboard for some reason, I could select the text and
press Ctrl-C, select the text and then choose Copy off the Edit menu,
or choose Copy off the context menu, or maybe click a toolbar button.
So you can intearact with the application and not only the DOM when
using Ruby? Or do you use Ruby to call some sort of API that does
that? I don't know Ruby at all .. and would those CTRl+C, etc actions
work on all OS (Win, OSX, Linux, ..)?

> I also want to add some basic performance measuring and security testing to the tests. ... Finally, I'd like to build in some of the usability testing that Julian Harty talks about on blog.bettersoftwaretesting.com
I understand that measurement need, I personally avoid that as the
goals of a functional test is nothing compared to performance/response
time tests.
Working for large companies that work with big data center, this is
something that was always already monitored in real time by hardware/
software on hosting machines. But when I did, I created/used JMeter
plans to have some performance results, which then again are usually
not always relevant because they were ran without any real life data
situation. But that's another story :)

> Andy
Thanks for reading and the reply!

Keep them coming folks :)

Andy Tinkham

unread,
May 5, 2011, 11:17:15 AM5/5/11
to seleniu...@googlegroups.com
Ah, I see how you use clones. Makes sense.

I use Cucumber more to serve as an easy way to communicate what's being tested to the non-technical stakeholders. I'm also hoping to get my non-technical team mates to be able to write tests directly too (even though I'll have to write al the back end code for it either way).

Page Objects are things that I think apply well across many applications. They're particularly useful when you have largely static pages. The specific page objects I've got are specific to my app, of course, but otherwise, I'd suggest that most people considering building a test automation suite should at least understand the concept and think about whether using this structure makes sense in their context.

Ruby & Selenium don't give me access to non-web things - I use the copy text example because everyone immediately gets it. There are similar things in my app where there's multiple ways to achieve things (like registering a patient through the normal hospital admittance process or through the emergency room), but those tend to be more cumbersome examples. I am pulling in a GUI automation tool for my client/server apps - I'm planning to use the win32-autogui gem to control those apps where Selenium doesn't fit.

For the performance measurement stuff, I want to stress that what I have planned around my functional tests is not in any way the extent of our planned performance testing. I'm thinking more of a canary in a coal mine type scenario, where we have indicators that things have changed to help guide the full performance testing efforts.

Thanks, Scal!

-----Original Message-----
From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Scal
Sent: Wednesday, May 04, 2011 4:00 PM
To: Selenium Users

--

Samantha

unread,
May 5, 2011, 12:20:32 PM5/5/11
to Selenium Users
I am about 3 weeks into a C# framework for testing. Here's what I
have done so far:

Everything is "object based"...

I have an object called "TestingEnv" that is really just a structure
to hold information about this run of tests...It holds:
- A web driver (determines which browser is going to be used for a
test),
- A base URL (determines which box is going to be used for testing
Dev, Staging, Prod, or someone's sandbox)

I built something called a "testing base" that is used as a base class
for everything that interacts with a web page. I guess conceptually
you can think of this as a browser object. The testing base takes the
TestEnv object in it's constructor and stores it in a modular level
variable. The base has a few methods that any of it's descendants can
use like:
- NavigateTo (navigates to a url after adding on the baseURL)
- SaveHTML
- SaveScreenGrab
- ExecuteJavaScript
- GetAlertTextAndClickOK


Then off of the testing base I have a level of inheritance that acts
as a base for all page objects called the "PageObjectBase" class. The
PageObjectBase is a decendant of the TestingBase class.
PageObjectBase's constructor takes in a TestingEnv object and passes
it to the TestingBase class. The constructor also takes in a pageURL
that is the URL of the page that is being represented by this page
object. The page object base contains a protected variable to hold
this URL and also a hashtable used to hold locator information for all
testable elements on the page. The methods of the PageObjectBase take
care of the following functionality:
- Decode locator strings
- Locate and interact with elements (lots of methods for this stuff)
- Confirm that all locators are valid (ie: the web interface hasn't
changed since the tests were written)
- Navigate to the page associated with the page object
- Verify that the page has loaded
- Logout (on every page as a convenience)


Every pageObject is derived from the pageObjectBase.... So when I
need a new page object I create a descendant of the pageObjectBase,
The constructor of the new page object accepts a TestingEnv object,
defines the relative URL of the web page, and fills the locator
hashtable for all elements that we may want to ever use in a test. All
of the hooks to the web page (the locators and URL) are contained at
this level. This makes it relatively easy to update the tests as the
UI evolves. I generally create public properties for every input
field on the page and methods for most common actions.

As an example if I were writing a page object for the gmail
composition page (where you compose an email) I would create a public
property for "ToAddress", "Subject", and "Message Body" and I would
create methods for "ClickSubmit()" and also a method
"SendMail(toAddress,Subject,MessageBody)" Again the page objects
represent a single page of the application. At some point I will have
over a thousand of these page objects for our software since we have
over a thousand pages in our UI. Job security:check.

So if you know how our application works it's relatively easy to build
tests based on the page objects.

There are a few basic principals to follow when using page objects
1) No testing/validation should be done in page objects...
Page objects may throw errors to be bubbled up but they never to QA
assertions. This will allow the page objects to be generic and easily
reusable.
2) Methods that cause new pages to load should return page
objects for the destination page
3) Locator values (the one real hook to the page elements)
should be stored in the LocatorHash table so they can be updated
easily

All well and good so far I hope. Perhaps the biggest issue is that
you really have to know the interface to develop tests. I get around
that by creating a series of methods that wrap up "common actions".
Our web application (as most do) works with entities... I'll use
widgets as an example.... I basically created a class called
"WidgetActions" that does things with widgets regardless of how pages
interact with each other. The might be a method called
"DeleteWidgetNamed(name)" that navigates several pages to perform the
action requested. These come in really handy when building tests since
things are in normal human terms.

Here's the general flow for creating a test:

1) Pick a browser and a base URL (ie testing box) and stuff them in a
TestingEnv object.
2) Create a test object (decendant of Testing base) and let it store
the TestingEnv
3) Use PageObjects or CommonActionObjects to perform actions
4) Use public properties or methods of PageObjects to validate that
actions produced the expected results.

I believe this approach set me up for the future pretty well....If I
want to test against a specific box, change the value of one property
in one place.... If I want to test using a different browser,change
the value of one property in one place.

Does anyone see any problems with this?
















I use as a base class for all page objects.

Scal

unread,
May 7, 2011, 10:23:35 AM5/7/11
to Selenium Users
Hi Samantha and thanks for sharing.
I believe we are quite close to features and how our framework works.
I personally don't have a PageObject notion, I simply call Selenium
object. I guess that's a kind of PageObject notion anyway?

I pretty much do the same parametrization, where a project has a
browser and base url property to run test on, this is where my "clone"
approach comes in handy. Clone a project and just change the browser/
base url and you have an exact copy of test cases but for a specific
environment.
And the framework will allow to turn a "clone" into a "master" so that
it can not depend on test cases it was referencing to anymore.

All these projects/test suites/test cases/actions/etc. are stored at a
DB level and a web interface (currently building it) will allow me to
manage all my data within a web interface, where anyone with common
sens (and permissions) can create/edit/delete projects/test suites/
test cases/actions/etc. content/properties.

Cheers;

Adrian Longley

unread,
May 4, 2011, 6:08:43 PM5/4/11
to seleniu...@googlegroups.com
Hi,

I've started this project over the last two weeks to deal with the many issues the team I have been working with have faced in automating an ajax-heavy site from .Net using Selenium WebDriver. From the readme:

Coypu is:

* A robust wrapper for .Net browser automation tools such as Selenium WebDriver and WatiN to ease automating js/ajax-heavy websites

* A more intuitive DSL for interacting with the browser, inspired by the ruby framework Capybara - http://github.com/jnicklas/capybara

If your test code is littered with waits, retries, element IDs and complex xpath expressions and your tests are still unstable as elements become visible/invisible/removed from the DOM then Coypu is aimed at you.

Would very much appreciate any feedback and/or contributions from anyone using Selenium WebDriver from .Net.

Cheers,
Adrian

Bob McConnell

unread,
May 10, 2011, 9:25:32 AM5/10/11
to seleniu...@googlegroups.com
From: Scal

> I am wondering who in the community (at least in the Google groups)
> has build it's own test framework for Selenium (whatever version /
> language)?
> By framework, I mean to be able to dynamically populate either:
> - test data
> - commands

Sorry I'm late with this response, but I was on vacation all last week.

I spent a great deal of time a couple years ago setting up basic
functional tests for one of our production sites. When I was assigned to
maintain that rather complicated site, I needed to verify that I didn't
break any existing features as I added several new ones. The resulting
test suite is now part of both the development and build processes for
that site.

First, let me describe our development process. We have multiple servers
set up in a local VMWare ESX farm, and a simple method to clone any
local VM at any time. So there is a development server VM, a QA server
VM and a user acceptance test VM. The production site is on a hosted
server farm. I only have access to the first VM, which is shared with
other developers. Therefore, the need for me to be able to clone off a
VM to run some experiments on my own desktop.

Once I have my code, unit tests and Selenium tests ready, they are
checked into a Perforce CMS server. This check in triggers a Hudson
build process which creates .rpm files for both updates and new
installs. QA can then install those on their server. They also take the
Selenium scripts and run them as a regression test to verify both a new
site and their updated sites. Then they are free to do fuzz tests,
recheck known problems from previous releases and try any edge cases
they have come up with. Once they are done, the changes can be installed
on the UAT server so Support and clients may review them. After they
give their approve, the updates are installed on the production server
farm.

Any problems found, and any client issues raised by Support, are
returned to me accompanied by an .xhtml file recorded and saved with the
Selenium IDE. This insures that I have all the steps needed to reproduce
those problems. Once the problem is fixed, these tests are exported and
become part of the next build.

Now for my test setup. I use Perl with its excellent Test::Harness as
the test framework. I use a YAML file for the base parameters and others
to hold data for iterative tests. Base parameters include the test site
name, build number and browser. The Hudson process creates two of these
files to be used for a set of tests run during the build. It then
installs both a new site and updates an existing site on the development
server and runs the tests. If these tests fail, the build fails and I
get to figure out why and fix it.

The data file populates a hash of hashes with test names, input data and
expected results. I use the YAML module from CPAN to import that data,
then iterate the test over the resulting HoH. There are tags within that
file that are replaced during the import process. These are particularly
useful for dates, where current values for last year, this year and next
year can be substituted at run time. That way we don't have to edit the
expected string every year to keep them in sync.

All of my test scripts are TAP compliant, so the Perl Harness generates
my test reports for me. Failures are easy to track down, but not always
so easy to fix.

I also use YAML files for unit tests on Java code for another project.
Those are imported using the snakeyaml package. We have discovered that
both QA and our managers have no problem reading them and can even add
or modify test cases at will.

I do have one final comment. Some may consider the multiple server setup
as overkill, particularly for one or two developers. However, fifteen
years ago when I was maintaining a private site with just HTML and a
little CGI, I still had duplicate servers running, one in my home to
develop and test my changes, and the other at my ISP, which only got
updated after I had verified that all of my changes worked correctly and
somebody else had proofread the changes and new pages. I've seen too
many "amateur sites" on the WWW get screwed by accident up over the
years. It is so easy to set up a Linux box with Apache, PHP and
Postgres, that I am not about to get caught messing around with the live
site.

Bob McConnell

Preeti Kumari

unread,
Jun 14, 2017, 3:08:51 AM6/14/17
to Selenium Users
Hey guys,
Can anyone provide me a sample test automation framework in selenium ruby. I am new to selenium ruby.I am not using maven by the way. so wud be great... if anybody provides. 

Krishnan Mahadevan

unread,
Jun 14, 2017, 3:10:08 AM6/14/17
to seleniu...@googlegroups.com

Preeti,

 

See if this helps : https://github.com/atinfo/awesome-test-automation/blob/master/ruby-test-automation.md

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <seleniu...@googlegroups.com> on behalf of Preeti Kumari <pku...@astegic.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Wednesday, June 14, 2017 at 12:31 PM
To: Selenium Users <seleniu...@googlegroups.com>
Subject: [selenium-users] Re: Do you have your own test framework? What are it's capabilities? Share ideas/thoughts/experience/etc.

 

Hey guys,

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.


To post to this group, send email to seleniu...@googlegroups.com.

Preeti Kumari

unread,
Jun 14, 2017, 3:54:47 AM6/14/17
to Selenium Users
Thanks Krishnan, actually I am trying to inherit one test file with another. But that is now working at all. Showing some error like this "D:/rubyworkspace/dub/Appopen.rb:3:in `<main>': uninitialized constant Appopn (NameError)"
ruby.png

Krishnan Mahadevan

unread,
Jun 14, 2017, 3:59:03 AM6/14/17
to seleniu...@googlegroups.com

Preeti,

 

Am not *Ruby literate*. But it looks like you need to add a require statement to include “LoginClass”.

You can refer to this post on StackOverFlow : https://stackoverflow.com/a/16514057

Preeti Kumari

unread,
Jun 14, 2017, 4:29:45 AM6/14/17
to seleniu...@googlegroups.com
That one is also not working showing some error like "D:/rubyworkspace/dub/Appopen.rb:3:in `<main>': uninitialized constant Appopn (NameError)"


Thanks & Regards;

Preeti Kumari |Quality Analyst
----------------------------------
Astegic Infosoft-Delivering Technology Solutions
 


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/C4D9588F-BA17-4DD1-B3C9-B83844FBAF2C%40gmail.com.

Krishnan Mahadevan

unread,
Jun 14, 2017, 4:31:36 AM6/14/17
to seleniu...@googlegroups.com

In that case, I would suggest that you share more details on what you have so far.

Maybe you can share

  • the source code,
  • how you are setting up your IDE
  • how you are setting up your execution environment
  • Ruby version that you are working.

 

And any additional details that you feel can help someone to debug your problem.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <seleniu...@googlegroups.com> on behalf of Preeti Kumari <pku...@astegic.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Wednesday, June 14, 2017 at 1:59 PM
To: <seleniu...@googlegroups.com>
Subject: Re: [selenium-users] Re: Do you have your own test framework? What are it's capabilities? Share ideas/thoughts/experience/etc.

 

That one is also not working showing some error like "D:/rubyworkspace/dub/Appopen.rb:3:in `<main>': uninitialized constant Appopn (NameError)"


 

Thanks & Regards;

 

Preeti Kumari |Quality Analyst

----------------------------------

Astegic Infosoft-Delivering Technology Solutions

 

 

 

On Wed, Jun 14, 2017 at 1:28 PM, Krishnan Mahadevan <krishnan.ma...@gmail.com> wrote:

Preeti,

 

Am not *Ruby literate*. But it looks like you need to add a require statement to include “LoginClass”.

You can refer to this post on StackOverFlow : https://stackoverflow.com/a/16514057

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.


To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Preeti Kumari

unread,
Jun 14, 2017, 4:40:43 AM6/14/17
to seleniu...@googlegroups.com
See , I have installed latest selenium and ruby plugin within eclipse. I have created a simple login.rb file having login code. Now I want to integrate  another testcase file (which is appopen.rb file) with this login.rb in which I am getting problem .

here is the login file code:

  require "selenium-webdriver"
  require "test/unit"
class LoginClass < Test::Unit::TestCase
     def setup
      #Selenium::WebDriver::Chrome.driver_path = File.join(File.absolute_path('', File.dirname("C://Projects/Selenuim/Drivers")),"Drivers","chromedriver.exe")
      @driver = Selenium::WebDriver.for :firefox
      @driver.get('*******.html')
      #@driver.manage.window.maximize    
    end
  
  
    def teardown
    #  sleep 10
      #@driver.quit
    end
  
  
    def test_login
      @driver.find_element(:css, "#S3_input_email").send_keys "*****.com"
      @driver.find_element(:css, "#S3_input_password").send_keys "****"
      @driver.find_element(:css, "#input_login_button").click
     # sleep 0.3
     # assert(@driver.find_element(:id => "loggedin").text.include?("You Are Logged in"),"Assertion Failed")
     # @driver.find_element(:id, "logout").click
    end
  end


Thanks & Regards;

Preeti Kumari |Quality Analyst
----------------------------------
Astegic Infosoft-Delivering Technology Solutions
 


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0877364F-A12E-40EF-985C-049B953C6176%40gmail.com.

Krishnan Mahadevan

unread,
Jun 14, 2017, 5:52:19 AM6/14/17
to seleniu...@googlegroups.com

Preeti,

 

Here’s what I had. I got rid of the error you were facing but am seeing some other errors. (Since I am not sure how to work with Ruby, I am leaving it to you or to others to help debug)

 

List of files in my current directory

15:15 $ tree

.

├── appopn.rb

└── login.rb

 

0 directories, 2 files

 

login.rb looks like below

 

require "selenium-webdriver"

require "test/unit"

class LoginClass < Test::Unit::TestCase

  def setup

    @driver = Selenium::WebDriver.for :firefox

  end

 

  def test_mytest

    @driver.get('http://www.google.com')

    assert(@driver.current_url().include?("google"),"Assertion Failed")

  end

 

  def teardown

    @driver.quit

  end

end

 

 

appopn.rb looks like below (In your screenshot I noticed that class had a capital C)

 

require './login'

 

class Appopn < LoginClass

  def setup

    puts "Nothing to setup"

  end

end

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <seleniu...@googlegroups.com> on behalf of Preeti Kumari <pku...@astegic.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Wednesday, June 14, 2017 at 2:10 PM
To: <seleniu...@googlegroups.com>
Subject: Re: [selenium-users] Re: Do you have your own test framework? What are it's capabilities? Share ideas/thoughts/experience/etc.

 

See , I have installed latest selenium and ruby plugin within eclipse. I have created a simple login.rb file having login code. Now I want to integrate  another testcase file (which is appopen.rb file) with this login.rb in which I am getting problem .

From: <seleniu...@googlegroups.com> on behalf of Preeti Kumari <pku...@astegic.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Wednesday, June 14, 2017 at 1:59 PM
To: <seleniu...@googlegroups.com>

Subject: Re: [selenium-users] Re: Do you have your own test framework? What are it's capabilities? Share ideas/thoughts/experience/etc.

 

That one is also not working showing some error like "D:/rubyworkspace/dub/Appopen.rb:3:in `<main>': uninitialized constant Appopn (NameError)"


 

Thanks & Regards;

 

Preeti Kumari |Quality Analyst

----------------------------------

Astegic Infosoft-Delivering Technology Solutions

 

 

 

On Wed, Jun 14, 2017 at 1:28 PM, Krishnan Mahadevan <krishnan.ma...@gmail.com> wrote:

Preeti,

 

Am not *Ruby literate*. But it looks like you need to add a require statement to include “LoginClass”.

You can refer to this post on StackOverFlow : https://stackoverflow.com/a/16514057

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.


To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.


To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Preeti Kumari

unread,
Jun 14, 2017, 5:58:32 AM6/14/17
to seleniu...@googlegroups.com
I just renamed that and executed again. Still getting error
Inline image 1


Thanks & Regards;

Preeti Kumari |Quality Analyst
----------------------------------
Astegic Infosoft-Delivering Technology Solutions
 


On Wed, Jun 14, 2017 at 3:21 PM, Krishnan Mahadevan <krishnan.ma...@gmail.com> wrote:

Preeti,

 

Here’s what I had. I got rid of the error you were facing but am seeing some other errors. (Since I am not sure how to work with Ruby, I am leaving it to you or to others to help debug)

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/AB7E5A64-47F3-4C53-94FA-6ECC807793EC%40gmail.com.

Krishnan Mahadevan

unread,
Jun 14, 2017, 6:04:33 AM6/14/17
to seleniu...@googlegroups.com

Please read my earlier response once again.

 

Your screenshot shows Class Appopen whereas you should have been using class Appopen (I think class is a keyword in ruby and it has to be in small case I think).

 

And if your statement require “Loginclass” does not work, then you might want to try using require “./Loginclass” (to indicate to ruby that it has to look in the current directory for the file Loginclass.rb).

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <seleniu...@googlegroups.com> on behalf of Preeti Kumari <pku...@astegic.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Wednesday, June 14, 2017 at 3:27 PM
To: <seleniu...@googlegroups.com>
Subject: Re: [selenium-users] Re: Do you have your own test framework? What are it's capabilities? Share ideas/thoughts/experience/etc.

 

I just renamed that and executed again. Still getting error

nline image 1

From: <seleniu...@googlegroups.com> on behalf of Preeti Kumari <pku...@astegic.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Wednesday, June 14, 2017 at 2:10 PM

From: <seleniu...@googlegroups.com> on behalf of Preeti Kumari <pku...@astegic.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Wednesday, June 14, 2017 at 1:59 PM
To: <seleniu...@googlegroups.com>

Subject: Re: [selenium-users] Re: Do you have your own test framework? What are it's capabilities? Share ideas/thoughts/experience/etc.

 

That one is also not working showing some error like "D:/rubyworkspace/dub/Appopen.rb:3:in `<main>': uninitialized constant Appopn (NameError)"


 

Thanks & Regards;

 

Preeti Kumari |Quality Analyst

----------------------------------

Astegic Infosoft-Delivering Technology Solutions

 

 

 

On Wed, Jun 14, 2017 at 1:28 PM, Krishnan Mahadevan <krishnan.ma...@gmail.com> wrote:

Preeti,

 

Am not *Ruby literate*. But it looks like you need to add a require statement to include “LoginClass”.

You can refer to this post on StackOverFlow : https://stackoverflow.com/a/16514057

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.


To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.


To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.


To post to this group, send email to seleniu...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Preeti Kumari

unread,
Jun 14, 2017, 6:06:46 AM6/14/17
to seleniu...@googlegroups.com
ok! Krishnan 


Thanks & Regards;

Preeti Kumari |Quality Analyst
----------------------------------
Astegic Infosoft-Delivering Technology Solutions
 


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/fflP09KAkZQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/9399D042-2653-4055-8D92-D1A3EC648927%40gmail.com.
Reply all
Reply to author
Forward
0 new messages