selenium

How to select 2nd Level SubMenu in Selenium WebDriver with Java

萝らか妹 提交于 2021-01-28 09:22:40
问题 I have been trying all possible answers that were provided for similar Query. My lay-out Structure of the Menu: MainMenu1 , Manimenu2.... etc Under Each Mainmenu Submenu1>Item1, Item2, Item3 Submenu2>Item1, Item2, Item3 Submenu3>Item1, Item2, Item3 To get to Item1 or Item2 or Item3, we have to move the mouse over and hover it over Mainmenu1>submenu1 and then click Item2 I was able to use mouse-hover command and get it open the Mainmenu but unable to get past it. Any suggestions Please?

Get current HTML of rendered page using Selenium

对着背影说爱祢 提交于 2021-01-28 09:21:53
问题 I'm strugling to get the rendered html code in selenium of a facebook app. After login I go to the app page and use time.sleep(20) to wait for it to fully render. I have already tried 3 solutions none of witch works: self.driver.page_source # This one returns source code self.driver.find_element_by_xpath('//*').get_attribute('outerHTML') self.driver.execute_script("return document.getElementsByTagName('html')[0].outerHTML") I'm using the google chrome driver and python3. Just to be clear.

Clicking submit button using Selenium

梦想与她 提交于 2021-01-28 09:11:14
问题 I'm very newbie at this. I'm trying to login a website using Selenium to make some web scraping but I can't succeed in clicking the submit button. This is what I'm using: browser.find_element_by_name("submit").click() And this is the html form code from the web: <div _ngcontent-ihr-c27="" class="form-group"> <button _ngcontent-ihr-c27="" class="btn-fantasy green big" gtm-action="Login_Mail" gtm-category="Interaccion" gtmeventclick="" type="submit"> Iniciar sesión </button> </div> Any

System.InvalidOperationException : Error forwarding the new session cannot find : Capabilities {browserName: chrome, marionette: false}

蹲街弑〆低调 提交于 2021-01-28 09:06:25
问题 I am trying to run my Selenium C# automated test using Grid . When i run the test I get the error: Message: System.InvalidOperationException : Error forwarding the new session cannot find : Capabilities {browserName: chrome, marionette: false, platform: WINDOWS} I have chromedriver.exe in the following directory: F:\Selenium Projects\C#\Grid practice\automation\ I have set the path for Environment Variables from System, Control Panel to the path: F:\Selenium Projects\C#\Grid practice

Scraping a React-table using Selenium

心已入冬 提交于 2021-01-28 09:01:03
问题 I have written a code for scaping an HTML React table by using python selenium. But it cannot catch values in the table(only DOM elements). Here is the website https://nonfungible.com/market/history/decentraland?filter=saleType%3D&length=10&sort=blockTimestamp%3Ddesc&start=0 Here is my code: from selenium import webdriver dr = webdriver.PhantomJS(r'PATH_TO_PHANTOM/phantomjs-2.1.1-macosx/bin/phantomjs') dr.get("https://nonfungible.com/market/history/decentraland?filter=saleType%3D&length=10

How to use Selenium to click a button in a popup modal box

限于喜欢 提交于 2021-01-28 08:51:00
问题 I am trying to use Selenium in Python to pull some data from https://www.seekingalpha.com. The front page has a "Sign-in/Join now" link. I used Selenium to click it, which brought up a popup asking for sign-in information with another "Sign in" button. It seems my code below can enter my username and password, but my attempt to click the "sign in" button didn't get the right response (it clicked on the ad below the popup box.) I am using Python 3.5. Here is my code: driver = webdriver.Chrome(

How to retrieve a sub-string from a string that changes dynamically with respect to multiple delimiters through Selenium in Python

谁说我不能喝 提交于 2021-01-28 08:50:43
问题 I wonder if its possible to remove part of the scraped string like: Wujek Drew / Uncle Drew into Uncle Drew Of course, as it is web scraping, the titles will be different every time, so what can I do here to get the result above? Update I forgot to add something that need to be removed also. Wujek Drew / Uncle Drew (2018) I Will need to delete the data at the end of the string. 回答1: To remove first part of the scraped string separated by / character you can use the following solution: value =

How to get total number of nested frames inside the frame

僤鯓⒐⒋嵵緔 提交于 2021-01-28 08:41:03
问题 Snapshot of Frame_top with 3 nested frames: Code: WebElement topframe = driver.findElement(By.xpath("//frame[@name='frame-top']")); String frame1 = driver.switchTo().frame(topframe).switchTo().frame("frame-left").findElement(By.xpath("//body")).getText(); System.out.println(frame1); List<WebElement> nestedFrames = driver.switchTo().frame(topframe).findElements(By.tagName("frame")); System.out.println(nestedFrames.size()); On top you can see this page has nested frames inside the frame(frame

Click on check box after confirming text in html table which is dynamic

﹥>﹥吖頭↗ 提交于 2021-01-28 08:38:22
问题 I need to click on the check box in the HTML table after asserting the text. Below is the html. <div class="k-widget k-grid "> <div class="k-grid-header" style="padding: 0px 16px 0px 0px;"> <div class="k-grid-header-wrap"> <table> <colgroup> <col width="50px"> <col> <col> </colgroup> <thead> <tr> <th aria-sort="" colspan="1" rowspan="1" class="k-header checkbox-grid-column"><input id="c3c07f7e-5119-4a36-9f67-98fa4d21fa07" type="checkbox" class="k-checkbox"><label class="k-checkbox-label" for=

Search keyboard Appium Java not function

我怕爱的太早我们不能终老 提交于 2021-01-28 08:25:49
问题 try to find a solution for this topic and none of the answers all the websites won't help me, Search keyboard Appium Java not function example not helping codes: ((AndroidDriver) driver).pressKey(new KeyEvent(AndroidKey.ENTER)); same with: driver.sendKeyEvent(AndroidKeyCode.ENTER); or: ((AndroidDriver)driver).pressKeyCode(66) or: ((AndroidDriver)driver).pressKeyCode(84) I'm using this appium version: <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>6.1.0