Selenium Webdriver takes long time to run - selenium

Webdriver taking a long time to run than ide why, is there a way to execute my web driver example in already opened firefox browser, Since I was new to Webdriver I need good tutorials, Please share the examples of whatever u have...

The best way is to work on it and learn as you work. Write a simple code, understand it, add complexities and figure out how to solve.
A tutorial can only help you get started.
To that end, a good starting point can be http://seleniumhq.org/docs/03_webdriver.jsp.
Use the sample codes there to start off.
Other good resources are :
http://code.google.com/p/selenium/wiki/GettingStarted
http://code.google.com/p/selenium/wiki/NextSteps
And nope, you cannot execute your test in an already opened browser.
Hope it helps.

Related

Selenium with Robot

I am automating the GUI using Robot framework with selinium2Library. I am using selenium IDE and I don't find any record and play option for the Robot framework.
Is it possible for record and play back option for the test cases with Robot framework using selenium2Libbrary instead of writing test cases manually?. Appreciate some early response on this one.
Looks like you might got in confusion because of the work selenium which is different when you use it in RobotFramework.
I believe that you have to write the test cases, and you may Pycharm IDE where you get the context help for the in built as well for the user written keywords when the resources are imported.
However, I remember reading in a thread, but could not trace it. Here you can find article on how you can use Selenium IDE to record, but haven't tried myself. You may try it and see how it goes for you.
But I strongly believe that if you write the test, you can organize them into different reusable keywords than depending on the recording the stuff. Good luck.

How should I record the script for Java Applet in Selenium?

Here is the thing I want to do:
First I want to record the script in Selenium for Java Applet (EditLive) and then convert it into TestNG and then run it in Eclipse.
If you know some other automation tools for recording EditLive and then integrating it with Selenium, please let me know.
Thanks!!!
I'm sorry, but apart from the Robot class, which makes it kinda hard to actually do anything, I don't think that's possible.
Using any other recording tool you could record interaction with it, but you can't save it and use it as TestNG test then. But maybe I'm wrong and somebody actually invented one that can export its script into Java...

Selenium using conditional statements

I just started looking into selenium for automated testing for the past few days and am getting pretty stuck. I've been looking for documentation on this but haven't found anything very helpful but maybe one of you have found something interesting, if so I'd love to read it.
Anyway, here's the problem: I need to open up a website. This website takes in some parameters which takes the browser to another site, however if the parameters are invalid then the next site will display a message saying "An error has occurred".
If the second site doesn't error out like this we want to store a few arbitrary values and echo them later. If the site does error out we want to mark the error and move on. Right now, if the second site is invalid selenium stops running.
The only way it seems to do this is to have an if-else statement though I haven't found any mention of one in selenium. I have read somewhere that you can create some javascript on your own and then input that into selenium. The problem there is that I don't know how to actually input the javascript into selenium.
I hope that wasn't too confusing.
Thank you,
Jesse Smothermon
My coworker found it. code below:
<tr>
<td>storeEval</td>
<td>(selenium.isElementPresent("variable_looked_at")?selenium.getText("variable_looked_at"):"N/A")</td>
<td>Address</td>
</tr>
Thanks,
Jesse Smothermon
I am fairly new to selenium too, but I think what you want to do is use the Selenium IDE and export to visual studio or something. When you use selenium with visual studio (C#) you have complete control over the flow of the test. its much more easier to program something like that. but at the same time, you need to configure it with Nunit or selenium RC.
Also out there is a selenium extension called "Flow Control". I have not used it, but I believe it will allow the Selenium IDE to do if/else/etc
As a unit test, if the second site has failed, the unit test has failed. Perhaps rather than looking for a conditional processing of your unit test, fix the problem that causes the test to fail.
That may sound a little harsh and forgive me if it does, but it sounds illogical to me that you would want to take this approach.

What are the different versions of Selenium, and which one should I get?

I'm trying to get started with Selenium, but it's extremely confusing for anyone who still doesn't know the project.
If I go to the Selenium download page I get 7 download links for things with different names, and no description of what is each one. And then the Selenium 2 download link points to a page with another 8 files.
What does all of that mean? Which ones are deprecated? Which files should I get?
What are the differences between version 1 and 2? Is the version 1 deprecated, or do we still need to mix some modules from version 1 together with version 2?
And then, after searching on Google, I find Which Selenium Tool Should I Use?, but it's a very outdated page (last edited in 2007). It also talks about a limitation of the JavaScript testing interface: Same Origin Policy. Does this limitation still apply nowadays?
What are "Selenium Core", "Selenium Remote Control", "Selenium IDE"?
How about "Selenium (standalone) Server"? Is it the same thing as the Remote Control, or something different? What is the difference between Selenium Remote Control and Selenium Server?
And then I reach an official FAQ that is also confusing, and talks about a WebDriver thing that was going to be part of Selenium. Is it already inside Selenium? Is that FAQ up-to-date? How does it relate with other Selenium parts?
After all, another way to understand this question is: "I've never used Selenium before, I'm completely lost, and the documentation doesn't help." What I need is an introduction of what are all the parts of the project, which ones are old and deprecated, which ones are needed, which ones are interchangeable, which ones work with different browsers...
(maybe it would be a nice idea to have a community wiki answer that tries to be as accurate and detailed as possible)
I'm not much experienced with Selenium, but recently I have started it to automate form submissions while unit testing. For starters, try Selenium IDE. It is a Firefox addon which will help you to record actions and modify/replay them.
Actually more than that. You can perform Accessor operations, which will perfom a series of recorded/configured actions and will store the end results for us to analyze later.
And then there is Assertions, which will actually check the end state of a series of actions with some pre-configured conditions.
One thing I can say you is that Selenium is very handy and easy to learn. You can write your own test cases using plain html!
Here is a great beginner video - http://wiki.openqa.org/download/attachments/400/Selenium+IDE.swf?version=1
After seeing that, read through this tutorial - http://jroller.com/selenium/
And after that, read this reference - http://release.seleniumhq.org/selenium-core/1.0/reference.html
It explains everything you need to know. If you are first to Selenium, you will be amazZzed to see what all things selenium can do.

Selenium browser detection

Good morning
I have been running a few tests over the past couple of weeks and I have come up against a bit of a wall.
I am testing in IE 7 and 8 and firefox.
Basically my problem is that IE 8 does not yet support a plug in and firefox does not support a referer in a frameset, so basically I want to do is detect which browser I am using and then if its ie 7 run the tests, else skip certain tests, is this possible?
Thanking everyone in advance for their help.
Cheers
Cameron
I might be missing something (probably!) but if all you're trying to do is target tests to IE then would conditional comments work?
<!--[if ie 7]>
The tests go here.
<![endif]-->
Just a note for anyone else who reads this: the question is around using Selenium Core and the solution is designed to edit the HTML-based test suite file. If you're using Selenium RC, you obviously know which browser you launched :)
Hmmm one solution that came up in my mind... maybe it's a little bit odd, but I think it should work: let your Web app. read the HTTP UserAgent and save it as a hidden HTML input field. Then you can access it from your Selenium tests and decide whether you want to continue running them or not.
Maybe there's a better solution, I don't know.