cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Functional Web Testing

SOLVED
Super Contributor

Re: Simple Functional Web Testing

Did you remove this line from the code?

 

import java.util.concurrent.TimeUnit

Please remove this code and then rerun it.

 

Community Manager

Re: Simple Functional Web Testing

Thanks everyone for your awesome suggestions!

@ranujn, did you find the solution? Please share it with us.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Contributor

Re: Simple Functional Web Testing

@avidCoder , Yes I removed this one - import java.util.concurrent.TimeUnit

 

Now my code looks like this

 

import org.openqa.selenium.*
import org.openqa.selenium.chrome.ChromeDriver

//Initiate WebDriver
System.setProperty("webdriver.chrome.driver", "C:/chromedriver_win32 2.42/chromedriver.exe");
log.info(System.getProperty("webdriver.chrome.driver"));

WebDriver driver=new ChromeDriver();

 

Still getting the same error 

Tue Jan 29 09:43:16 AEDT 2019:ERROR:java.lang.NoSuchMethodError: com.google.common.util.concurrent.SimpleTimeLimiter.create(Ljava/util/concurrent/ExecutorServiceSmiley WinkLcom/google/common/util/concurrent/SimpleTimeLimiter;

Super Contributor

Re: Simple Functional Web Testing

Hi @ranujn 

 

  1. First of all the selenium-standalone-server version you are using is not at all compatible with the chromedriver verison.
  2. The soapui version should also be compatible with the selenium-standalone-server version.

Please follow below steps:-

  1. Download selenium-server-standalone-2.41.0 jar - selenium-standalone-server+IEDriver
  2. Download IEDriverServer_x64_2.41.0 
  3. Download chromedriver_win32_2.26 - chromedriver
  4. Download soapui_5.4.0
  5. Download httpClient_4.3.4 - httpclint

Put all the jar file inside bin/ext folder and restart your soapui.

 

Then please try below code:-

 

import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
import org.openqa.selenium.*

//System.setProperty("webdriver.ie.driver", "C:\\Program Files (x86)\\SmartBear\\SoapUI-5.4.0\\bin\\ext\\IEDriverServer.exe")
System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\SmartBear\\SoapUI-5.4.0\\bin\\ext\\chromedriver.exe")
//def driver = new InternetExplorerDriver()
def driver = new ChromeDriver()
driver.get("https://google.co.in")

I have tested it for IE and Chrome. and it is working fine. Please try all the steps from your side.

And, Let me know, for any issues.

 

Hope this solution helps you out. Please accept as solution and don't forget to give kudos. Smiley Happy

 

Thanks,

avidCoder

View solution in original post

Contributor

Re: Simple Functional Web Testing

@avidCoder Finally, It worked for me. Thank you so much for your help. :-)

 

Could you please guide me with some materials/blogs from where I can understand how to pass the value and get the response back to the ready API. It will be helpful for me. 

 

Thanks once again. :-)

Super Contributor

Re: Simple Functional Web Testing

I didn't understand the whole context. What value you want to pass and get it retrieved in ReadyAPI? Please be more clear. So that I can be more helpful.

Contributor

Re: Simple Functional Web Testing

@avidCoder  Below are the steps that I need to follow

1) Get the response from the API

2) Start Chrome connection

3) Visit a particular page

4) Enter the response in one of the field and click on submit.

5) check if the response code is correct then 

5) Wait for a sec (It will generate another button)

6) Click on the new generated button and so on.

Super Contributor

Re: Simple Functional Web Testing

It's quite easy. I can give you a suggestion and you can search the solution step by step.

 

1. Get the response from API - I have already answered this earlier, How to fetch the response from the API.

def response = context.expand('${API_NAME#Response}')

2. Start Chrome Connection - Use selenium code, which I have already given to you.

3. Visit a Particular page -  Already answered, How to navigate to (Google Page)

4. Enter the response in one of the field and click on submit - Here, Please inspect the element(Where you want to enter the response) by pressing F12 and also inspect Submit button element. Here is sample code:-

WebElement responseField =  driver.findElement(By.name("Write the locator value")).sendKeys("Enter the response which you fetched from API");
WebElement submitButton = driver.findElement(By.name("Write the locator value")).click();

5. Use if else to check whether response is correct or not.

6. Use Thread.sleep(No. of milliseconds) to wait.

7. Again wait Until the new button is enabled. Once it is enabled (use if else and selenium functionality) click on that button.

 

Please go through some of the selenium pages which I have already shared. You will get an idea. Try to learn it. 

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors