Locator issue for changed frame

+1 vote
Hello,

In the application under test I am facing one issue of locator identification.

We have one webpage to test where there is one video, dashboard and graphs.

I want to mouse hover on the graph / dashboard to make it zoom so details can be seen. Here I dont want to click on it.

Same is with Video where I want to right click on video and need to share it with other resources.

It looks like video and dashboard are in different frames than the page.

Not able to automate it using python selenium.

I tried with all the locators. I used Chropath also.

Any suggestion how to switch between frames in python selenium

Thanks in Advance

Ads...
Aug 27, 2019 in Selenium by ADS
• 280 points
1,026 views

1 answer to this question.

0 votes
Hi ADS, can you please share your code which is causing the problem?
answered Aug 27, 2019 by Abha
• 28,140 points
Hey,

driver = webdriver.Chrome("C:\\SeleniumItem\\chromedriver.exe")
driver.get("https:")

time.sleep(10)
def frame_switch(XPath):
    driver.switch_to.frame(driver.find_element_by_xpath("/html[1]/body[1]/div[2]/main[1]/div[2]/div[1]/div[4]/div[3]/div[1]/ul[1]/li[4]/div[1]/div[1]/a[1]/img[1]"))
    
driver.switch_to.default_content()

I cannot share the site url due to security reasons.

Well, Same I tried for video frame where I need to right click and select share.

I am not able to move on any of the frames.

Another point is please check below code if its good for right click and select the option from available options.  With this code I am able to click anywhere on the webpage but not able to select options available.

NewAct = ActionChains(driver)
link = driver.find_element_by_xpath("/html[1]/body[1]/header[1]/nav[1]/div[1]/div[1]/a[1]/img[1]")
NewAct.move_to_element(link).context_click().send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

Related Questions In Selenium

0 votes
1 answer

How to resolve the issue: Xpath for node without text but child has text

This will help you: //strong[not(normalize-space(text()))]/span[te ...READ MORE

answered Jun 11, 2018 in Selenium by Samarpit
• 5,910 points
4,368 views
0 votes
1 answer

Python Selenium (waiting for frame, element lookups)

You could use WebDriverWait: from contextlib import closing from selenium.webdriver ...READ MORE

answered Sep 14, 2018 in Selenium by Martin
• 4,320 points
2,115 views
+2 votes
1 answer

Reading the excel and running multiple URL's in the browser and updating the excel if issue found for those URL's

Try the following steps: use excel application scope and pass ...READ MORE

answered Jan 21, 2020 in Selenium by Karan
• 19,610 points
3,192 views
+1 vote
2 answers

Python with Selenium issue: “Chrome is being controlled by automated test software”

from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("useAutomationExtension", False) chrome_options.add_experimental_option("excludeSwitches",["enable-automation"]) driver ...READ MORE

answered Apr 20, 2020 in Selenium by Manoj
15,897 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8, 2019 in Selenium by Anvi
• 14,150 points
15,838 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,674 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,143 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,221 views
0 votes
1 answer
0 votes
2 answers

Unable to switch back to default frame

Hi Shubham, you can switch to a ...READ MORE

answered Aug 26, 2019 in Selenium by Abha
• 28,140 points
2,624 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP