49746/how-to-do-session-handling-in-selenium-webdriver
Hey Lalita, you can perform following steps to handle different sessions in Selenium Webdriver:
public class CreateSessions { @Test public void createSession1(){ //First session of WebDriver System.setProperty("WebDriver.chrome.driver","..\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://www.google.com/"); driver.findElement(By.xpath("//*[@id='lst-ib']")).sendKeys("Test"); driver.close(); } @Test public void createSession2(){ //Second session of WebDriver System.setProperty("WebDriver.chrome.driver","..\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://www.google.com/"); driver.findElement(By.xpath("//*[@id='lst-ib']")).sendKeys("Test"); driver.close(); } }
Next, configure the testng.xml file by adding parallel attribute to the suite tag:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="TestSuite" thread-count="3" parallel="methods" > <test name="test"> <classes> <class name="tests.CreateSessions"> </class> </classes> </test> </suite>
using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); ...READ MORE
First, find an XPath which will return ...READ MORE
You first need to download chrome driver ...READ MORE
You many not actually be able to ...READ MORE
The better way to handle this element ...READ MORE
enable trusted connection in internet explorer by ...READ MORE
To Allow or Block the notification, access using Selenium and you have to ...READ MORE
xpath are two types. 1) Absolute XPath: /html/b ...READ MORE
Hi Sushmita, to solve Synchronization issue in ...READ MORE
Check the below code: Here is the working ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.