SeeTest (Mobile automation) support for serenity - serenity-bdd

we are trying to implement serenity to test mobile application using SeeTest automation tool. can anyone guide what will be best way. currently we are able to connect to the device with the help of wrappedSeeTestDriver.once the execution completes results are generated but screen shots are not captured. also operations like sendText("{ENTER}"); also not working. Any suggestions idea will be great help.

To achieve BDD with SeeTest, you can use SpecFlow with C#. Below are high level Steps:
Write acceptance criteria of your test case in a FeatureFile as scenarios in Gherkin language.
Write StepDefination - where you write underlying implementation for each line in feature file in C#.
When you build your project, all the tests in your feature file will be displayed TestExplorer.
Right click and execute any test you want.
SeeTest will generate the HTML report, screenshots, logs and other outputs in TestResults folder of your project.
sendText("{ENTER}");:
The sendText({Enter}) (or also the 'BKSP') is basically try to use the enter from the android keyboard, and it is a possibility that this application or specific activity on the application developed different.
If you are using seeTestAutomation and open the application in the reflection and spotify to the right place when you testing the enter, try to press manual in the the computer's keyboard 'enter', is it working?
Also please try with adb command (run command in seeTest) "adb shell input keyevent 66" (66 is the keycode for enter) and if this won't work - it means that the enter command is not implemented this view of the application.

Related

automating the tests where application running under citrix xenapp

I am hardly trying to automate some of the scripts for regression testing in the application, but the challenge am facing over here is, the application running under the Citrix XenApp so am not able to automate it in a usual way(Selenium & UFT) please anyone help me to find the way to automate the application under citrix :)
With Citrix, like any other image based screen, you can use :
Insigth Object to locate and interact with images on the screen
GetTextLocation method to locate text using OCR (optical character recognition)
Low level recording to click at some screen location, by coordinates
SendKeys function to input text on the screen

How to record test cases with robotframework?

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.

Porting CLI/GUI Windows program to OS X

I have a Windows program that has a GUI which also uses a command line interface (a cmd Window) as a debugging console. Basically, when it is double clicked, it launches a command line window and then the program creates all the GUI windows. Then you'd have two Windows: the main GUI and a debugging console.
I'm trying to port this pogram to OS X. Because OS X (and all Unix OSs for that matter) doesn't automatically launch a command line window when you run a command line application. So, I obviously need another way to port this application.
My initial thought was simply to import the source code into a XCode project, redirect standard input and output and then port the GUI. The GUI and console would run side by side just like in Windows. I don't think this is the most optimal solution since that would mean I'd essentially have to write a terminal emulator.
My other thought would be to port the application as a command line application which creates its GUI just like in Windows. The application would then have to be run from Terminal.app which could handle all the I/O. Unfortunately, I don't think you can use the Cocoa framework without using a NSApplication loop.
Any ideas how I could approach this?
You can of course create a run loop from a terminal-launched app. But that generally isn't what you want to do.
It sounds like on Windows, the CLI is just being used as a shortcut to creating a real debugging console window. So the simplest answer is to create a debugging console window. It's pretty easy to create a window which contains just a multi-line text or list view. (If you want something fancier, consider borrowing code from iTerm2 or other open source projects instead of trying to build a complete terminal.) If your debug information is being printed with some fancy macros, just change the macros to log to your list view.
If you're directly doing something like fprintf or syslog to do your logging, it might be simpler to create a wrapper app that launches the main app, and the wrapper creates the debugging console window and displays the main app's stdout and/or stderr. (This might be as simple as using popen.)

How to test File Download dialog box using cucumber/capybara

I searched around and couldn't find how to test a file download box using capybara/cucumber?
The following image asks the question much clearer.
This was similar to another question I just answered, hope it helps Anybody have idea how to test file download using cucumber?
#Millisami Capybara::NotSupportedByDriverError Fixed for me!
What i had to do is removing the #javascript tag from my cucumber test, which was included. I mean:
#search
Scenario: Recieving a file
...
instead of
#search
#javascript
Scenario: Recieving a file
...
Hope it helps :-)
The download box is a function of the browser. Capybara simulates a browser but without all the UI etc.. (e.g. it looks like a browser to your application, so using it you'd mostly skip over the whole file download UI stuff. It would look to the browser like someone did whatever they needed to in order to tell the browser where to put the file and start the download)
If you are trying to test a download box, (beyond clicks needed to start the download) you are now testing the browser, not your application. As yourself if that's part of your charter and worth your time.
To actually test the download box you are going to have to have a browser instance going, and use a tool like Firewatir/Watir or Selenium, to actually 'drive' the browser, and some other gem to actually automate up at the OS UI level (on windows we usually use autoit) in order to click things and fill in values of the browser's file download UI.

Attribute Error: On selenium-python script

I am using Selenium-python script for web test automation. When ever I use selenium inbuilt commands, I will get Attribute error during run time.
Ex: selenium.WindowFocus("preview_email") throws "AttributeError: class selenium has no attribute 'WindowFocus'"
I am new to test automation. Help me to sort out this problem.
The command that you are looking for is selenium.window_focus()
I have never used the Python client personally, but a quick glance at the selenium.py file reveals that there is a window_focus command which gives the currently "selected" window focus ("selected" in Selenium terms is the window that Selenium is currently executing commands against and not necessarially the window that has user focus).
Executing the select_window command with a window ID will set tell Selenium which window you want to execute commands against.
I have had some trouble w/ popups in general and the way the Selenium IDE and RC clients attempt to locate new windows and/or there parents. Good luck.
I think you want to force web-driver to go to another window with name "preview_email".
For this purpose, you need to use selenium.switch_to_window("preview_email"); because selenium.window_focus() just gives focus to the currently selected window and accepts no arguments. Additionally you used it in JAVA mode (I mean selenium.windowFocus()).