Answers for "selenium interview questions"

0

selenium interview questions 2019

String setPROXY = "10.0.0.10:8080";

org.openqa.selenium.Proxy allowProxy = new.org.openqa.selenium.Proxy();
allowProxy.setHTTPProxy(setPROXY)
          .setFtpProxy(setPROXY)
          .setSslProxy(setPROXY);
DesiredCapabilities allowCap = new DesiredCapabilities();
allowCap.setCapability(CapabilityType.PROXY, allowProxy);
WebDriver driver = new FirefoxDriver(allowCap);
Posted by: Guest on December-29-2019
0

selenium interview questions 2019

<suite name="SuperSuite">
  <suite-files>
    <suite-file path="subSuite1.xml" />
    <suite-file path="subSuite2.xml" />
    ...
  </suite-files>
</suite>
Posted by: Guest on December-29-2019
0

selenium interview questions 2019

from selenium import webdriver

PROXY = "10.0.0.10:8080" # IP:PORT or HOST:PORT

chrome_opt = webdriver.ChromeOptions()
chrome_opt.add_argument('--proxy-server=%s' % PROXY)

chrome = webdriver.Chrome(options=chrome_opt)
chrome.get("<< target URL >>")
Posted by: Guest on December-29-2019
0

selenium interview questions 2019

public class LogInPage
{
    @FindBy(id="userName")
    private WebElement user;

    @FindBy(id="password")
    private WebElement pass;

    public LogInPage() {
        PageFactory.initElements(browser, this); // Setup the members as browser.findElement()
    }

    public void processLogIn() {
        user.sendKeys("john");
        pass.sendKeys("password");
    }
}
Posted by: Guest on December-24-2019
0

selenium interview questions 2019

// Set up the JS object
JavascriptExecutor jscript = (JavascriptExecutor)webdriver;
// Issue command to enter the text
jscript.executeScript("document.getElementById('textbox').value = 'Some Text';");
Posted by: Guest on December-23-2019
-1

selenium interview questions

How to switch between multiple windows in Selenium?
Ans. Selenium has driver.getWindowHandles() and driver.switchTo().window(“{windowHandleName}”) commands to work with multiple windows.

The getWindowHandles() command returns a list of ids corresponding to each window and on passing a particular window handle to the driver.switchTo().window(“{windowHandleName}”) command, we can switch control/focus to that particular window.

for (String windowHandle : driver.getWindowHandles()) {
     driver.switchTo().window(handle);
}
Posted by: Guest on March-10-2021

Code answers related to "selenium interview questions"

Browse Popular Code Answers by Language