How to get request of a element by using selenium.
public void TestFlightSubmit(){
driver.findElement(By.className("primaryBtn font24 latoBlack widgetSearchBtn"));
}
Is there any way so that I can get request of this element by passing its className and save it into my HAR file.
Failed to get all the Page View requests and Clicked Requests on the web application
I had coded a test case for Automation in Selenium to get all the requests on the web page including Clicked Elements. But I think I'm not able to get all the requests on my web page. Can anyone help me how can I get all requests especially Clicked Elements Requests.
My Code: @BeforeTest
public void setUp(){
proxy = new BrowserMobProxyServer();
proxy.start(3000);
Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);
System.setProperty("webdriver.chrome.driver", driverPath+"chromedriver");
WebDriver driver = new ChromeDriver(capabilities);
proxy.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.REQUEST_BINARY_CONTENT, CaptureType.REQUEST_HEADERS, CaptureType.REQUEST_COOKIES);
proxy.newHar("MakeMyTripSearchFlights");
driver.get("https://www.makemytrip.com/");
}
@Test(expectedExceptions = { IOException.class })
public void TestFlightSubmit(){
driver.findElement(By.className("primaryBtn font24 latoBlack widgetSearchBtn"));
}