Need to integrate my Selenium tests with REST APIs

0 votes
I have written a few web tests with Selenium. Now, I need to test the REST APIs & drive my browser with Selenium to verify the results displayed in my browser with the results generated when I launch my API urls. My API URLs are in HTTP mode and the answer is in JSON format.

So, I found rest-assured : https://code.google.com/p/rest-assured/ which shows a possible way out...I just want to verify if it's even possible to integrate it with my selenium tests or if we have a better alternative.
Apr 17, 2018 in Selenium by kappa3010
• 2,020 points
362 views

1 answer to this question.

0 votes

Selenium is good enough for this purpose...You can probably use waits() for the results to become available in the DOM. So you can use Selenium to test REST calls especially if your results update the HTML displayed on the page. Refer to this:

WebDriver driver = new FirefoxDriver();
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.id("myDynamicElement")));
answered Apr 18, 2018 by king_kenny
• 3,650 points

Related Questions In Selenium

0 votes
1 answer

Need to perform parallel execution (multiple browser sessions) with Selenium & TestNG by using @BeforeSuite

@Beforesuite annotated method runs before the testNG.XML ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,090 points
1,303 views
0 votes
2 answers
0 votes
1 answer

Need to select an IFrame with selenium (python)

Well for me, something like this worked. ...READ MORE

answered May 3, 2018 in Selenium by sniffy_god
• 780 points
911 views
0 votes
1 answer

I need to release the memeory allocated to Selenium chromedriver.exe while for tests

The usage of the commands is incorrect. driver.close() ...READ MORE

answered May 21, 2018 in Selenium by sniffy_god
• 780 points
667 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
545 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
880 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
540 views
0 votes
1 answer

Need to scroll down for locating an Element with Selenium

There are a couple of options for ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,650 points
374 views
0 votes
1 answer

Need some advise on the preferred element locators with Selenium WebDriver

Well let's not call it "Hierarchy". But, ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,650 points
91 views