Recording steps in browser in IntellIJ - selenium

Is there any way to make a browser recording in IntelliJ IDEA, how it is possible in Katalon Studio or Selenium IDE?

Katalon Studio is a test automation product that includes a web recorder and an Eclipse-based code editor (as well as some other stuff like API testing tool, object repository, etc.).
IntelliJ IDEA is an integrated development environment.
So they don't have the same purpose as Katalon Studio is a software that combines many functionalities, one of them is a part of an integrated development environment.
One thing you can do is to use Selenium IDE to record a script and then export it to one of the following programming language / testing libraries:
C# + NUnit
C# + xUnit
Java + JUnit
JavaScript + Mocha
Python + pytest
So you can export it to a Java/JUnit script and open it in IntelliJ.

Related

How to integrate LeanFT Selenium with HP QC

Now I am using Selenium (Java + Maven + Jenkins + TestNG + GitHub) with Microsoft Test Manager (Test Management Tool) for UI Automation. Microsoft Test Manager provides the APIs to integrate/map the manual tests from test manager to automated tests from Selenium.
Now we are planning to use LeanFT with Selenium (with LeanFt we can use Selenium, .Net- Visual Studio or UFT) for UI automation and HP QC (Test Management Tool).
Here I want to know:
How to integrate LeanFT Selenium with HP QC or How to map manual tests from HP QC to automated tests in LeanFT Selenium? (If you are using QTP/UFT you can open the manual test in QC and click on QTP/UFT icon to create related automated test).
Which tool can be used for SCM or Version Control, git and GitHub or LeanFT provides in built support for java code also? (In case if you are using QTP, no need to use external SCM).
From where to run the tests, from Jenkins or QC (In QTP + QC integration, you can run tests directly from QC also)?
Let me try to answer your questions:
Which version of HPE ALM(QC) you use? Is it already the new gig called ALM Octane? In case you have an older version you need to think about VAPI-XP Tests. This is the generic test type for everything that HPE QC doesn't support out-of-the-box. Newer versions of HPE ALM however support LeanFT as a Test Type. Here is the offical doc on test types for the latest version and here a little tutorial.
Unlike UFT, LeanFT is just the Test Automation Framework, it does not come bundled with an IDE (Which I personally consider good) - so depending on the IDE you use to develop code (eclipse, intellij, visual studio) - you can and should use any plugin that supports it. Definitely git is an easy and good pick.
Jenkins has plugins to trigger UFT Tests from QC or the FileSystem and then pick-up results automatically. In the case of LeanFT as mentioned it neither comes bundled with an IDE or Test Execution Engine so you can use JUnit, TestNG or any other execution engine to achieve this. For doing full Continuous Integration; QC is not that good (HPE seemed to abandon development there) so it is definitely Jenkins. The new Gig(Octane) did not even try to build an own CI System but just wrapped Object models of existing ones into it's own pipeline representations. For integrating with QC, you may have to write some scripting / utilities to upload stuff to QC using the OTA API - which is the client side Automation Framework of HPE QC
Below are the tutorials for OTA API if you need them
https://sumeetkushwah.com/2015/03/19/connecting-almqc-using-hps-otaopen-test-architecture-api/
And here is a github project with alot of examples and wrapper functions
https://github.com/sumeet-kushwah/ALM_OTA_Wrapper
Best place to run tests is from jenkins as suggested by Bela. Below is the article detailing that process
https://sumeetkushwah.com/2015/03/24/implementing-ci-using-jenkins-and-uft/

Katalon - export recorded test script to java/junit

Is there an option to export recorded test script to Java/JUuit(similar to slenium IDE) in Katalon studio? Because the application I'm working on is compatible only with IE; so I couldn't use selenuim IDE. so I'm forced to find someother tools to play/record sessions.
Appreciate your help in advance! Thanks!
As of version 4.8 Katalon Studio does not support export test cases to other frameworks. But if you want more control on your project, you can modify test cases directy in the Script Mode using Groovy/Java. It is also possible to import 3rd party Java libraries to your project if need be.
After creating the test case with some steps, we could view the script and adjusting it, for examples: https://docs.katalon.com/display/KD/Test+Case+Script+View
From here, we could add more codes to handle our testing flows.
However, since the code uses some Katalon libraries, so it might not posible to copy the script and run somewhere else.
you can export code into java/ python using Katalon browser plugin. Just import existing test case recording into the plugin and click on "export" option.
Yes you can export it Java (Junit, TestNg), python, C#, Ruby.
Download the chrome pluging
https://chrome.google.com/webstore/detail/katalon-recorder-selenium/ljdobmomdgdljniojadhoplhkpialdid
Follow the guide screen
Create a Maven Java project, create a new Test class file and copy paste the code and run the project to test the browser test.
Done !
You can record your test and export in the following language and framework:
C#
Java
Python
Robot Framework
Ruby
It is an extension for chrome like Selenium IDE
you can find it here

Is there any framework which supports Behaviour driven approch (bdd) for selenium-webdriver with driver managment?

I want to start my automation project from scratch, as per requirements I have to use Behavior Driven Approach for testcase authoring and selenium for Automation. please suggest best suited framework.
You can check open source QMetry Automation Framework for web (selenium-webdriver) and mobile (appium) automation. It has all the features driver management, parallel execution, run configuration you want and many more like data-driven testing, data-bean, locator repository, integration with third party tools (CI, Test Management tools etc).
It support BDD, keyword-driven and coded (TestNG test) approach for authoring test cases. So you can opt bdd for test authoring.
You also will find inbuilt bdd steps ready to use for selenium webdriver and rest-webservices with the framework.
You can start by downloading blank project from git which uses ANT and IVY. If you want to use maven you can download qaf-blank-project-maven.
For getting started follow step-by-step-tutorial

Source Control for Selenium Tests written in Java

In my company, I have plans to introduce Web Automation using Selenium WebDriver and Cucumber JVM using Maven builds.
Since the developers write their code in C#, they are all using TFS for source code repository and recommending the QA team also to use TFS to maintain my tests written in JAVA.
These are the questions I have got in my mind:
QA team will use IntelliJ IDE for writing Selenium tests in JAVA. Is IntelliJ compatible with TFS? Or is it a pain to configure it to work with TFS?
As we will move towards TDD very soon, we have to setup CI server as well.
Is it possible for me to run Selenium Tests triggered from TFS or do I need to use a separate CI server like Jenkins or Teamcity?
Does maven build work smoothly with TFS?
We have to adhere to stringent ISO guidelines for maintaining the source code. If I were to recommend source code repositories like github, can I ensure that the code is still secure? Is it difficult to setup the security in github?
Answering your questions regarding TFS:
IntelliJ IDEA supports TFS up to TFS 2015. Check:
Visual Studio Team Foundation Plugin for IntelliJ and Android Studio
Using TFS Integration
TFS supports CI build. After you've deployed a Windows build agent or an Xplat build agent, you are ready to define a CI build that compiles your Java app with Maven whenever your team checks in code.
Yes. Check:
Build your Java app with Maven

Help with Selenium Webdriver download?

I have Selenium IDE and i want to install Selenium Webdriver.
1) Can anyone tell me where can i download selenium webdriver. i don't see any link available in the documentation.
2)Can i use selenium webdriver with PHPUnit? I see some materials saying php is not supported in selenium 2 however there are some download links available for phpbindings for webdriver what is this exactly?
3)If i have Selenium webdriver do i still need selenium server to run test cases in different browsers?
I would appreciate your answers...
I completely agree with you. They have a ton of documentation, but they do a horrible job of explaining what you actually need. It took me about 2 days to put all the pieces together. You will need a few things...
If you are running tests with C#, download NUnit, C# client drivers. Create a class library project in Visual Studio and reference the dlls (assemblies) for NUnit (for appropriate dotnet version) and the C# client drivers. Compile your class library. It should create a dll inside of the bin\Debug directory. Then go into NUnit, create a project, and then open your assembly in that bin\Debug directory. That should get you started.
If you're developing using Java, download JUnit (not NUnit) and then download the Java Client Drivers, and use Eclipse instead of Visual Studio. You can launch JUnit right from Eclipse.
I've only tried NUnit and JUnit before. But I'm sure PHPUnit can also be launched from Eclipse (educated guess). There seems to be the most documentation for Java and Python.. from experience, but I've been doing everything in .NET and I haven't had anything I couldn't solve.
The Unit Testing software isn't required, but the code the format add-ins for Firefox Selenium IDE will build the code for NUnit (C#) or JUnit (Java), etc... so most use those tools.
If you want to get some boilerplate code, go into Selenium IDE and turn on experimental features under options. Then export your C# code (or Java code) from the format menu after you've recorded your commands. It won't all convert 100%, so be aware of that. Just google from there to get questions answered.
One thing to watch out for... clickAndWait commands won't convert to click and wait in the code. You will either need to do an implicit wait or a thread.sleep wait after certain commands before you'll be able to access the next element if you're waiting for an action to occur. You will also want to turn on native events so you can fire certain JavaScript events. Your fire events won't work if the driver doesn't have this turned on. The WebDriver driver.
If you have any other questions, let me know.
You can download Selenium server as well as client driver from the following:
http://code.google.com/p/selenium/downloads/list
You can download "php-webdriver-bindings-0.9.0.zip" from the following source:
http://code.google.com/p/php-webdriver-bindings/downloads/detail?name=php-webdriver-bindings-0.9.0.zip
In C# context:
Now the better way of including packages in C# project is using nuGet. nuGet is packaging utility which when executed from its powershell command window, quickly downloads the dll files and links them to project. Below link details on how to use nUGet to install packages of selenium webdriver, selenium support and nUnit.
How to invoke/run different type of web driver browser using remote webdriver in C#