How to clickElement() and open the link in the same tab, not in a new window?

浪子不回头ぞ 提交于 2019-12-06 15:55:04
Bhupesh

First you need to clear target attribute with a blank by injecting javascript in your web element.

Then you can sclick on it and it will open link in same tab. the code somehow look like

webElem<-remDr$findElement(using = 'xpath',"/html/body/div/table/tbody/tr/td/table[2]/tbody/tr/tbody/tr/td/font/a[1]")
remDr$executeScript("arguments[0].setAttribute('target', arguments[1]);", list(webElem, ""));
webElem$clickElement()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!