Trying to work with BrowseEmAll browser using this Python 3.5 script:
from selenium import webdriver from selenium.webdriver.chrome.options import Options chrome_options = Options() chrome_options.add_experimental_option("beabrowser", "IE7") driver = webdriver.Chrome(executable_path = 'C:\\Program Files\\BrowseEmAll\\BrowseEmAll.exe', chrome_options = chrome_options) driver.get(r'sitename') driver.quit() And I have this problem:
Traceback (most recent call last): File "main.py", line 9, in <module> driver = webdriver.Chrome(executable_path = 'C:\\Program Files\\BrowseEmAll\\BrowseEmAll.exe', chrome_options = chrome_options) File "C:\Users\Username\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 67, in __init__ desired_capabilities=desired_capabilities) File "C:\Users\Username\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 91, in __init__ self.start_session(desired_capabilities, browser_profile) File "C:\Users\Username\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 173, in start_session 'desiredCapabilities': desired_capabilities, File "C:\Users\Username\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 233, in execute self.error_handler.check_response(response) File "C:\Users\Username\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 165, in check_response raise exception_class(value) selenium.common.exceptions.WebDriverException: Message: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> <HTML><HEAD><TITLE>Bad Request</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">/HEAD> <BODY><h2>Bad Request - Invalid Hostname</h2> <hr><p>HTTP Error 400. The request hostname is invalid.</p> </BODY></HTML> How to fix this error? All that the creators themselves write about the interaction of the browser with selenium here (and then in Java):
// Java example // This should either be // C:\Program Files (x86)\BrowseEmAll\BrowseEmAll.exe or // C:\Program Files\BrowseEmAll\BrowseEmAll.exe System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\BrowseEmAll\\BrowseEmAll.exe"); // Now you need to tell BrowseEmAll the browser it should use to execute your test cases. ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("beabrowser", "IE11"); // Now you can instantiate the driver like any other driver ChromeDriver driver = new ChromeDriver(options); // You can use the driver like any other selenium driver: WebElement element = driver.findElement(By.id("lst-ib")); element.sendKeys("TEST");