Finding a tab within a page using selenium webdriver - java

I am a newbie to selenium and am trying to access the tab full score card tab on the folloing website.
http://www.espncricinfo.com/icc-womens-world-cup-2013/engine/current/match/594903.html.
My code in Java is :
driver.get("http://www.espncricinfo.com/icc-womens-world-cup-2013/engine/current/match/594903.html");
driver.manage().timeouts().implicitlyWait(5L, TimeUnit.SECONDS);
driver.findElement(By.xpath("//*[#id='st_1']")).click();
However it does not seem to be able to find the tab. Can you please help.
Thanks

The "tab" is in an iframe
Before you can do anything with an element in an iframe, you have to "activate" the frame with driver.switchTo().frame("live_iframe")

Related

Unable to find element in browser opened by clicking link in App

I am trying to automate a hybrid app using appium for android and ios. I am able to click on the contact us link present in the app.On clicking it, chrome browser is opened and contact us page is displayed. There i am able to get the WEBVIEW of the browser and able to switch to the browser, but i am unable to find any elements in contact us page. I tried getting the pagesource of the page also, but it is showing the pagesource of my app only(As my app is hybrid).
Please help me on the issue.
My guess is you're using the AndroidDriver or the AppiumDriver of the generic type <MobileElement> Try using <WebElement> for locating the elements on browser instead :)

Unable to click on dropdown button in web view of iOS 11 in Appium

I am trying to automate a hybrid app using Appium in iPhone 6 real device.
I am able to locate the dropdown element with path and Appium shows it has clicked on the element also. But it is not actually clicked as the dropdown is not opening.
Please find below attached screenshot of the scenario
Any help will be highly appreciated
The element is a Select and not just a standard WebElement, so you must treat it as such.
Select dropdown = new Select(driver.findElement(By.id("RelationOption")));
Then you directly access which option you wish by visible text, value, or index.
dropdown.selectByVisibleText("Mother");

Select the "back" button of the Firefox browser to right click and Select the Option from the right click Menu in Selenium Web Driver - Java

I am using Selenium webdriver . I want to select the "back " button of the firefox and right click the back button and select an option.
I see there is "Actions" API to right click, But i am not able to select/find the "back" button element of the firefox to right click using selenium .
Can any one please help me .
Code iam trying is :: Using firefox Driver to inittate the Webdriver
Actions action= new Actions(driver);
action.contextClick(productLink).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.RETURN).build().perform();
In the above code , in place of "productlink", i should select the back button element of the firefox browser to right click .
You cannot do that with Selenium.
You can use AutoIT with Selenium to click on that.
Refer to the following article on how to use AutoIT.
http://toolsqa.wpengine.com/selenium-webdriver/autoit-selenium-webdriver/
Here is what you can do. Try to use "Navigation" Commands in selenium.
driver.navigate().to("http://www.DemoQA.com");
there are many commands you can perform on it. If you still find issues using it let me know.

WebDriver : Right Clicking Issue

WebElement element = driver
.findElement(By
.xpath("html/body/div[7]/div[2]/div/div[2]/div[1]/div[2]/div/div/div/div[2]/div[1]/div[1]/div/div[2]/div/table/tr/td[1]/div[2]/div[2]/div/div[3]/div/div/div/div/div/div[1]/div[2]/div[9]/div[4]/span/a/div/div[3]/div[2]"));
Actions builder = new Actions(driver);
builder.contextClick(element).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN)
.sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).build().perform();
System.out.println("right click should work now");
Hello guys!
I'm having trouble working on with the right click feature of Selenium WebDriver. As you can see above, I tried to execute that code (without error) but still WebDriver won't right click my desired page element.
I am currently writing test scripts for gmail file download. (Right Click + Save Link As)
I've tried Firefox profiling and it seems to work, but I think it's better if I will be able to test this way of downloading attachments.
Please advise.
Thanks a lot!

Modal page Automation using Selenium webdriver

I am using Java and selenium webdriver for WebAutomation. The scenario is like, when we click on the particular option the new Modal page gets opened. However, with help of Webdriver, when I click on that particular option the modal page is not getting opened. Please suggest me how can do this
It seems Click() is not happening on the Particular Option which opens up the modal page

Categories

Resources