So I have a Copy Link button at the system I'm testing, and that works. means if I paste it manually (ctrl+v) to the browser's url line , it's ok. But when I try using Keys nothing happens.
I need to OPEN a new tab, NAVIGATE to it, DELETE the about:blank (from the browser's url line), PASTE the URL, (that's already been copied), and press ENTER
Here is the code: 1)I open a new tab 2)I navigate to the tab
the first 2 actions work well. the rest don't seem to work for some reason (from this line: action.key_down(Keys.CONTROL).send_keys('a').perform() )
Code:
self.driver.execute_script('''window.open("","");''')
action = ActionChains(self.driver)
profile_window = self.driver.window_handles[1]
self.driver.switch_to.window(profile_window)
action.key_down(Keys.CONTROL).send_keys('a').perform()
action.send_keys(Keys.DELETE).perform()
action.send_keys(Keys.CONTROL).send_keys('v').perform()
action.key_up(Keys.CONTROL).perform()
action.send_keys(Keys.ENTER)