Selenium IDE login twice - selenium

I have to input credentials and log in into page twice by using Selenium IDE. How can I do it by using if-else statement? Is there any way to do this?

You can. But your question is quite vague. Maybe you could post your code? Learn about control flow (if-else, forEach, etc.) here.
Another possible solution could be to use the recording feature of Selenium IDE. This article shows you how to create a login test.

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.

Has anyone successfully used selenium-ide to enter data into google docs? If not is there another option?

I am trying to use selenium to enter data into google docs so that it is accessible to other selenium scripts. If not can anybody think of a way to accomplish this?
Selenium can be a little flaky with contentEditable areas because the way that Selenium "types" onto the page and how browsers really interact with that.
I would recommend inserting the text into the element with JavaScript and then doing the manipulations.
If you want a truer sense then I would recommend moving to Selenium 2 as the keystrokes are more OS native. This unfortunately does not work in the IDE and you will have to use Python, Java, .NET or Ruby to take advantage of it.