how to select radio button in twitter by selenium webdriver with python? - selenium-webdriver

select radio button in twitter such as picture below by selenium webdriver with python?

If you open the developer tools of the twitter page, you can see that the dialog contains an iframe (id = "new-report-flow-frame"). You should first switch to that iframe before searching for a radio button
driver.switch_to.frame(driver.find_element_by_id("new-report-flow-frame"))
driver.find_element_by_css_selector("[value='illegal_product']")

You should first switch to popup window with something like
driver.switch_to_window(driver.window_handles[1])

Related

How to open a page without clicking on the menu link using Selenium C#

I want to open the Part Catalog page without clicking on the submenu link. How can I write the code to do that using Selenium C#.
This is because the menus links changes according to the user login and I cannot use the ID to expand the menu and click on the Submenu. Is there is a way just to open the Iframe inside the page using SRC ?
Please someone help me on this issue.
Thank you

How to show a popup or dialog on click of menu tab of salesforce?

I am new to salesforce and there is a requirement to show a popup or dialog box (vf page) on click of menu tabs.
Please guide me if this can be done.
If you are using JQuery on visual force page then you can use JQuery Dialog to have pop up.
Please refer this link.

AngularJS: How to open native video player on mobiles

I am using vjs-video AngularJS plugin for rendering videos in my app. On desktop it shows them in ngDialog (by binding dialog window to ng-click of gallery element)
It's working ok, but on the mobiles I want to show native fullscreen player right after user clicked (tapped) gallery item. I know how to detect mobile and desktop in Angular app, but what to do next? Right now user have to tap on gallery item and then dialog is showing, after that user should make second tap on video.js player in dialog and then video start to play in native player, but I want to open native player right after first click.
Have you tried the JavaScript "requestFullscreen" api?
var elem = document.getElementById("myvideo");
if (elem.requestFullscreen) {
elem.requestFullscreen();
}
Here's a link to the mozilla docs on this api.
And here's a link to screenfull.js, a library that's supposed to make this even easier.

How to handle this popup in selenium webdriver

How to handle this popup in selenium webdriver
Actually it has only div id. no frame, window names. it's just a modal think.
Trying to click the buttons. But, unfortunately can't get focus of this
driver.findElement(By.xpath("/html/body/div[9]/div/div[2]/div[2]/div[1]/button")).getText();
driver.findElement(By.xpath("/html/body/div[9]/div/div[2]/div[2]/div[1]/button")).click();
Screenshot

Unable to click on Menu Bar>>Tools Menu in Mozilla Firefox using Selenium Webdriver

How to click on Menu Bar>>Tools Menu of Mozilla Firefox using selenium Webdriver?
You CAN'T do something like this. You just can handle the HTML elements, events and simulate actions between your HTML and the user. Selenium works with the DOM, is used to test your web application not to interact with the browser as OS an app.
You can use the following code:
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_L);
robot.keyRelease(KeyEvent.VK_L);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
And then use the right arrow to move from one element to another.

Resources