Puppeteer has connect function to connect with existing browser instance but in selenium ,how to connect to a existing instance of IE browser using selenium(webdriver) in javascript?
You can't do that because that function is for chromeDriver only
Related
When I want to send a key on google.com using selenium automation testing with google chrome then I ahve faced a error like the picture and code is
public ActionResult selenium()
{
IWebDriver webDriver = new ChromeDriver();
webDriver.Navigate().GoToUrl("https://www.google.com/");
webDriver.FindElement(By.Name("q")).SendKeys("Selenium");
return View();
}
you need to change ChromeDriver version bcs you have 85v and mybe your browser is with another version you need to check if the browser is a 85 version if it not desanstaled the browser and install version 85
I'm using robot framework with selenium for automating my web application.
I'm trying to open chrome browser and download a XML file and then parse it from the results folder ${OUTPUT_DIR}.
Every time I'm trying to download any file, chrome browser shows the windows prompt to download the file. I tried using the chrome options to disable the prompt, but it is not working. Please find the piece of code used to invoke chrome browser.
When tried using the regedit - PromptForDownloadLocation variable, it is working fine.. but I want to manage this using chromeOptions
Could you please help me with this.
ChromeDriver version : 79.0.3945.36
Robotframework - SeleniumLibrary version : 3.3.1
Create Webdriver and Open Browser
${CHROME_OPTIONS} = evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
${prefs} = create dictionary download.prompt_for_download=${FALSE} download.directory_upgrade=${TRUE} download.default_directory=${OUTPUT_DIR} safebrowsing.enabled=${TRUE}
call method ${CHROME_OPTIONS} add_experimental_option prefs ${prefs}
create webdriver Chrome chrome_options=${CHROME_OPTIONS}
I am running my script on chrome headless browser and it is not launching the url.
chrome Version : 70.0 , chromedriver: 2.44
System.setProperty("webdriver.chrome.driver","C:\\path\\to\\chromedriver.exe");`
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("window-size=1400,600");
WebDriver driver = new ChromeDriver(chromeOptions);
driver.get(url);
above code works on any other url's but one which i want to launch is not openning. This code is able to launch the url in phantomjs and also chrome without headless.
When trying to get source of the page in headless browser i am getting.
<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html>
Any help appriciated.
I am not able to click device back button using selenium Webdriver + AndroidDriver
Below is the code which I am using:
((AndroidDriver<AndroidElement>) driver).pressKeyCode(AndroidKeyCode.BACK);
gson 2.6.2
Java client 5.0.1
Selenium server standalone 3.6.0
Try this:
driver.navigate().back();
Activity activity = new Activity("appPackageName", "appActivityName");
activity.setAppWaitPackage("setWait");
activity.setAppWaitActivity("setWait");
activity.setStopApp(false);
((AndroidDriver) driver).startActivity(activity);
The above code worked for me.
i am unable t download the opera mini browser driver , like How we can follow the chrome browser. can u please provide the link . so its useful to work and open the browser.
Selenium webdriver don't support opera-mini (but I hope it will change.
For the moment if you want to test OperaMini on your computer for testing purpose you need to use MicroEmulator :
Installing Opera Mini on your computer
Good luck !
There is no OperaDriver exe to download( like for Chrome/IE).
You just need the Selenium jar file to instantiate opera driver instance. Please refer this link to get more details on Opera Driver