New answers tagged

1

If you are certain that XYZ and the default value will always be in the dict, you can use get() method like so: my_dict = { "XYZ": { "default": "xpath=//*[@id='root']", "iOS": "css=#name", "android": "name=//*[@class='android.widget.']", "web": ...


0

Xpath can find the previous sibling of any field in the DOM. Try using xpath like this: "//div[text() = '" + user_login.email + "']/preceding-sibling::div/a"


0

This is how I ended up solving the same problem in ASP.Net. But it should be quite forward to translate it to Java. int trial = 0; while (element.GetAttribute("value") != value && trial < 10) { element.SendKeys(Keys.Control + "a" + Keys.Delete); element.SendKeys(value); trial++; }


4

Yes, you are right, from Chrome capabilities documentations Use custom profile (also called user data directory) By default, ChromeDriver will create a new temporary profile for each session. Therefor you need to create and load a custom profile by user-data-dir. ChromeOptions options = new ChromeOptions(); options.addArguments("user-data-dir=/path/to/...


0

for my, this is correct: from selenium import webdriver profile = webdriver.FirefoxProfile('/home/user-name-pc/.mozilla/firefox/1kj45idd.default') driver = webdriver.Firefox(executable_path=your_path_selenium, firefox_profile=profile) driver.get('https://hello.com')


Top 50 recent answers are included