I am working on automating an inhouse automation testing software for my firm, I need to extract the X-path, or id of an HTML element when the tester clicks the webpage element like the login button during the manual testing process, need to extract data like element id or x-path, and what type of action he is performing like click, enter or filling the text box, etc. these data would be useful for integrating with my existing selenium script and perform automation testing, currently exploring feasibilities of computer vision. Kindly suggest some ideas to make it possible.
-I think you need to extract and read HTML of the page separately then perform any concept/Algorithm of computer vision to detect all elements of the page including text , buttons and drop down list....
Related
I recently started using robotframework with the Selenium2Library. I haven't tested using Selenium before, but I know it is possible to record tests using Selenium. In RobotFramework, it says, "it is not possible". I mean even for a simple login test, I need to write the test, specifying the id of username, password and submit button.
However, is there any way by which these tests can be recorded using robotframework? such as clicking on a text box, entering a string and then clicking on submit button etc., and automatically generate the test case source code instead of having me to write the test cases. Is this possible with robotframework or any external library that it supports?
robotframework wasn't designed to be a record-and-play tool, and has nothing built-in to support that.
There was someone who wrote a selenium IDE plugin that would generate robot keywords, but that was years ago. The github repository is here: https://github.com/denschu/selenium-ide-format-robotframework
The code hasn't been touched since 2012, so I doubt it's of much use.
Using this Firefox add-on, FireRobot we can generate most of the code and also using this you can select the elements on the screen and get related code suggestions on right click like
Wait Until Element Is Visible
Click Element
and all operations to perform on the selected element.
Today I got this from an interviewer. I am not sure if anyone cell tell me what should be the right way. Thanks
Below is the question
Consider www.google.com's search box and the Google Search button.
Q: How would you test this functionality?
How would you design test automation for 1) above?
When you're testing something, you want to find the points where the function, webpage, application, etc. break. It's unlikely that the interviewer is asking you to test search box portion of the Google homepage itself, as that is fairly simple (it's little more than a text input and a couple submit inputs inside a form), but rather find potential edge cases in the code which takes that input and produces the search results.
So, consider edge cases for a text input and a submit button in a form using a GET action:
What happens if you submit the form with no input?
What happens if you submit the form with too much input? (Both server and browser may impose limits on the URL generated by the GET, and those limits may be different.)
What happens if you include characters which have special meaning in a GET query string such as & and =?
What happens if you circumvent the page entirely, creating a different <form> which submits to the same page as Google's search box? What if you do this with some input values missing?
I have to login to application. But username and password text boxes available on different frame on the UI.
When i record using the IDE and exported into JAVA then same code is not working.
I am getting an error saying element is not present. This because the text box is on additional frame on the UI.
Kindly let me how to get the control of this frame and then enter the text.
Thanks,
Md Ashfaq
are you recording via ide on firefox and then running your tests on some other browser?coz sometimes diff browsers interpret it differently[I have faced issues where same webpage had iframes in firefox but not in IE].kindly check on that front.
Use The API capability to SwitchToFrame() then Look for element and interact with.
Note: You'll have to switch to any frame needed i find it efficient doing a selectDefaultFrame, try Iterating within Available frames and get handle/frame names
Can anyone tell me how to work with multiple edit boxes using Sikuli integrated Selenium WebDriver.
For example, I have 2 edit boxes which are labeled as username and password. So I want to click on the 1st edit box, then enter values and again want to click on the 2nd edit box. The size of the two edit boxes are the same. So how sikuli integrated Selenium WebDriver will identify which edit box to click.
If you are referring to the SikuliWebDriver, then this link has an example on the usage http://code.google.com/p/sikuli-api/wiki/SikuliWebDriver.
I would rather prefer using the Sikuli Java API and create wrapper functions around the Sikuli functions like click, type etc. This API is in active development and has good support available.
http://doc.sikuli.org/faq/030-java-dev.html
You can use the offset functionality. ie, you do not only use an image of the text field, but use a region of the screen which identifies something related to the text fields.
You may select a large rectangle which includes a heading above both fields, then use offset x/y coordinates and move the little crosshair over the exact location you wish to click/type.
I am currently working on a project which has few Id's in the first screen and depending on the Id selected, user is navigated to second page which displays respective Id's information. All the information displayed is retrieved from SQL database.
Here is my question how can I automate this using Selenium.
Thanks in advance
If you have a coding background I would suggest writing some basic automated tests with Selenium WebDriver. This will allow you to find elements on the page via their ids, get text from textfields, click on links, and verify that another page has loaded (sounds like the tasks you wish to perform?). You can structure your tests so they run through the main functionality path (eg. go from log in, to main screen, to another screen, testing all functionality along the way) and then you will only have to write a few tests. If you want full automation it is usually better to have specific requirements for your application and write a separate test for each. The Selenium homepage has some good documentation with code snippets to get you started, and a simple google search should provide you with several tutorials. Good luck :)