I'm trying to test whether logging into an account is successful using Selenium IDE.
Is there a particular command that I can use in Selenium IDE to test whether I can successfully log into my account on facebook for instance? Any help would be very much appreciated. Thanks!
There isn't a single command to fill out an entire form. However, the type command can be used for each field:
Replace username with whatever the actual ID of each field is (which can be seen by right-clicking the page and viewing the page source). You can use many other HTML attributes in this manner, such as name and class; have a look at the documentation for more examples.
Then, simply repeat this procedure for each field you wish to fill in. To actually log in, you'll need the click command targeting the Login button. This is used the same way as the type command above, but doesn't need anything in the Value field.
Once you're actually in, you can check if it was successful by using the assertText command, targeting something you know the value of (your profile name, for example). If Selenium-IDE can't find the element (or the name doesn't match), it'll let you know that the test has failed.
Related
I need to give a suite of test cases (Selenium IDE) to a client but I need the case parameters to be invisible or read-only to the client.
Is there any possibility of doing this?
Its quite unclear what you are referring to when saying "parameter". I assume these is the data (ex. values provided to your test cases, like userid, password, etc).
If you have inserted these value in testng.xml or as dataprovider in the code, then NO. There is no way you can hide it from client.
Instead you can fetch this data as from an external excel file and mark it as write protected. This will solve the your problem
I am new to web driver. I am supposed to test a registration form using selenium2. I am being told to use functional testing to test the form. I have to make tests like(enter username, password, confirm password and click on terms and conditions and only then the create account button gets enabled.I have to enter invalid username, password less than the specified length and for each test I have to assert if the create account button gets enabled.) Checked about functional testing but couldn't get the right information for my issue.
Appreciate help on this
Thanks
Java Beginner.
The fields which are present in the website are called as WebElements.
In Selenium, you can find the element and write string by using the code:
WebElement username = driver.findElement(By.id("your field ID"));
username.sendKeys("your value");
You can do the same thing for the password. Try using dataProvider concept in TestNG to pass different types of values to the same function.
For simple tests try Selenium IDE. Then select "Options -> Clipboard Format -> Java/Junit 4/Webdriver". Copy all the html code and paste in the framework you're using. It will allow you to understand basic workflow and syntax of the application.
In my project we have a web based tool where it collects all the exceptions that occur in log. The list of exceptions will be displayed in table and a icon will be displayed in a column to get the stack trace. Some one needs to check all those exceptions and we need to assign to different teams based on the keywords.
Eg : If the stacktrace contains "DB Connection error" it has to be assigned to DB team, if it contains code error like "classcast exception" in particular file then it has to be assigned to individual owning the module. Currently some one has to open each n every row in the table displayed and open the stack trace and do Ctrl + F and if any of those keywords are found assign it to respective team.
We don't have any access to the tool's database and it's web based. I need some good ideas to automate it. Please suggest me with which technology and idea to automate it.
Sounds like selenium + programming language of your choice is a good fit (even without a selenium).
You need to:
download source code of the page containing exceptions table.
Use any of these: wget, curl, selenium, urllib for python, etc.
put it into variable and extract exceptions list in convenient to you format.
Use any xpath-powered tool, like selenium, lxml for python, etc.
do your thing with the extracted exceptions list: search for keywords, assign tickets, etc.
Use programming language of your choice.
Definitely you can achieve this using selenium.
Following are the steps to follow.
Supply date criteria with type command to the boxes text boxes element.
click search button.
store the required text in variable using storeValue(locator, variableName).
click on image link if you are able to keep track of popup window else you have to use
$second=$sel->getAttribute("//html/body/.../a#href"); and now your $second has link address $sel->openWindow($second,"MyWindow2"); now select that new window $sel->selectWindow("MyWindow2"); and do operation of storing required data from the popup.
Now agian for selection of previous window use `$sel->selectWindow("null"); // hear $sel is object of selenium (i.e. $this).
Select your required option using select(selectLocator, optionLocator).
Use selenium RC for above steps so that you have more manipulation with the data stored and as per requirement operations.
In above steps syntax are of PHPUnit.
Please try the steps may help you.
Regards.
I've made my own user extension for Selenium IDE and one addition to it that I would like to make requires me to access weather or not the previous command was successful, or failed.
Is there a way to access this information?
I am currently evaluating possible solutions to limitations in Microsoft's Test Manager 2010 TestStep Editor control and I was wondering whether anyone knows if and if so, how you can write richtext to the Action and Expected Result fields of a step? As far as I saw it takes a 'ParameterizedString' as input, but I am not sure what parameters MSDN refers to (or the MTM TestRunner can handle) when saying "[...]Represents a string that has embedded parameters.[...]".
The Expected Results string is a list of string namees delimited by spaces, semi-colons or commas. You can enter something like: #Test, #Cart, #Book or #Test #Cart #Book.
You can't add HTML to the Expected Result parameters or the action; however, I am not sure I would describe this as a limitation. What action were you thinking you would need to be able to do this. Actions are typically "Click this" or "Go to here" Did you just want a stronger visual queue for certain parts of the action?
Here is an article that describes the intent with the expected results section:
The real power of the test case though, comes in the bottom portion of
the screen, on the Steps tab. This is where you list out the manual
steps the tester will use to test the application. Start typing where
it says "Click here to add a step." In the Action column, you add the
action that the tester should try and perform, such as "Open Internet
Explorer." In the Expected Results column, you list what should happen
when the action is performed, such as "Internet Explorer opens to its
default home page." To continue adding new steps to the test case, hit
Enter to go to a new line.
Not every action step requires an expected result. When an expected
result is specified, it turns that step into a verification step. With
a verification step, the tester will have to specify whether that
particular step was successful or not.
You have the ability to provide parameters to your test steps. This
allows you to run the test multiple times, each time using a different
value. An example of this would be testing different login values on a
Web site. Instead of creating a new test case for each login, you can
create one test case, and pass multiple login values into it.