WebDriver select element that has ::before

前端 未结 2 476
抹茶落季
抹茶落季 2021-01-12 00:39

I have 2 elements that have the same attributes but shown one at a time on the page (When one is shown, the other disappears).The only difference between the two is that the

2条回答
  •  臣服心动
    2021-01-12 01:39

    String script = "return window.getComputedStyle(document.querySelector('.analyzer_search_inner.tooltipstered'),':after').getPropertyValue('content')";
                            Thread.sleep(3000);
                            JavascriptExecutor js = (JavascriptExecutor) driver;
                            String content = (String) js.executeScript(script);
                            System.out.println(content);
    

提交回复
热议问题