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 :)
Related
My problem is when I click on a desktop icon, it opens a link in already opened chrome browser in a new tab. How do I attach with the already opened browser and not a new one?
The below code returns a null because there is no window opened through selenium ofcourse, so yeah.
Set<String> windows = webdriver.getWindowHandles();
System.out.println(windows);
Any suggestions would be of great help. Thanks In advance.
There is no way to attach the chrome window that you've opened from the desktop application to your WebDriver instance.
If you want to be able to control a web page with a Selenium - you must pass your URL to a driver like that:
webdriver.get("https://www.your_link.com");
You might think about the way of getting and storing your URL as a variable and passing it into your code.
That would also be helpful if you add a bit more details about the problem. It's a bit unclear at what stage of the test you open the web page with a desktop application. Selenium can't be used to test desktop applications. Code sample of the test from your project would also help.
i am using Selenium Webdriver on Java and I am trying to get the network status of every element with a network status like you can see in the image below.
Is there any way to get the status?
Edit:
I guess I cannot upload images. If you press F12 to open the dev-tools there is a network menu. If you click on it, the status of every webelement will show up there.
AFAIK DevTools and Networking tab controls are not natively supported by Selenium.
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");
I have a special problem. I made a software in java, what strore informations from a website. But this website shows this data, just if I click a button. It's a simple webdriver problem, but I can click a button only 10 times. It's a very big problem form me, and I cant't do this. :D
The site counts my clicks, if I reach ten clicks, it tells me, I should login. But, it possible to login only with facebook or google account. I don't want to login with facebook or google.
The solution is, I have to close the browser, and I have to reopen that. How can I do this:
driver.close();
driver = new FirefoxDriver();
Okay, but every time when I use this formula, the java code opens a new webdriver. What is the solutin of this problem? Maybe driver.quit(); ??
No!!
If I quit the driver, I can't create a new driver. So, when I open the 321654th webpage, I have 321654/10 webdriver among Windows tasks.
What is the real solution?
Have you tried deleting cookies? You might also then have to refresh the page.
driver.manage().deleteAllCookies()
Try with refresh your page instead of close. Use below code:
driver.navigate().refresh();
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")