Forum Discussion

sridevihiranya's avatar
sridevihiranya
Occasional Contributor
7 years ago

Unable to run selenium scripts in readyAPI

we have a requirement  to run selenium scripts in readyAPI

referred- https://support.smartbear.com/readyapi/docs/testing/integrations/selenium/about.html#_ga=2.44841956.1335706090.1511849454-710966217.1491193368

 

Code:

------------

import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebDriver;

System.setProperty("webdriver.chrome.drive","C:/Users/Desktop/Files/logs/chromedriver.exe");

WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");

 

---------------

 

Get the following error : Could not initialize class org.openqa.selenium.json.Json

 

 

How to launch web browser ?

 

8 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Any specific reason for invoking selenium tests thru ReadyAPI while web tests can be run separately?

    By the way, there is no such class used in the code snippet shown above. Is that all your code?
    • sridevihiranya's avatar
      sridevihiranya
      Occasional Contributor

      Tried the code given here - https://support.smartbear.com/readyapi/docs/testing/integrations/selenium/integrate.html

      Get the following error : Could not initialize class org.openqa.selenium.json.Json


      our requirement -
      1. I have a system, which needs to be switched ON via web link(automated using selenium).
      2. once the system comes online, I need to run API scripts.
      3. after API scripts run, switch off the system via web.
      4. As part of performance I need to keep repeat the above process multiple times.

      Can I achieve the above requirement using ONLY readyAPI?

      • nmrao's avatar
        nmrao
        Champion Level 3
        Yes, that should be quite possible. But, is your script working out side soapui (the web part)?
    • sprice090161's avatar
      sprice090161
      Contributor

      The tool supports launching Selenium test. I should think that s reason enough if you can extend your test cases. I was able to do the same thing until recently, my regressions just stopped working.

       

      Also the gentleman's description of the object is correct:

       

      WebDriver driver = new ChromeDriver();

      driver.get(URL);