Mobile testing
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mobile testing
Hi team,
1) I am doing mobile web testing using emulators. It is opening as a "smartbear test extension" started debugging this browser. Here i need to set a resolution based on the mobile we are selecting. So, i need to set a resolution over there.
>>refer the below code,
function main(){
VirtualBrowsers.Item("iPad").Run();
var mblPage=VirtualBrowsers.CurrentBrowser.Navigate("https://www.smartbear.com/");
var element=mblPage.FindElement("xpath");
element.click();
}
>>Here need to set resolution over there as width (768) and height (1024)
2) I tried to click over an element in that page but it throws error as TypeError: cannot read property "FindElement" of undefined
Could any one helpme regarding this issue??
Solved! Go to Solution.
- Labels:
-
Mobile Testing
-
Script Tests
-
Web Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have verified this option, but i didn't noticed that width and height. Thank you
How to accessing web objects in virtual browsers???
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like you normally do when accessing a browser.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you refer this code
function main(){
VirtualBrowsers.Item("iPad").Run();
var mblPage=VirtualBrowsers.CurrentBrowser.Navigate("https://www.smartbear.com/");
var element=mblPage.FindElement("xpath");
element.click();
}
>>error as "TypeError cannot read property "FindElement " of undefined
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Navigate Method doesn't return anything, and you are calling FindElement. You need to get the Page object - refer to TC documents, there's plenty of examples.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
var page=VirtualBrowsers.Item("iPad").Run("https://www.smartbear.com/");
here also page object return empty only
Can you pls help me here somewhere i am missing out the logic ???
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Run Method returns a Process object.
If you do a Google search for "testcomplete page object", the top result will point to https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/web/general/page/ind...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@rraghvani i can understand what you are saying but
Here I am using page object for virtualBrowser but it's throwing error as cannot read property "FindElement" of undefined
>>Navigate method doesn't return anything means now am using Run method. Now also am getting same error.
Refer the sample code below,
let page=VirtualBrowsers.Item("Apple iPad").Run("https://www.google.com/");
var element=page.FindElement("XPath");
element.click();
If I use Run method also page object doesn't return any object!!
Here I need to search like findelements method for mobile object
Literally confused her about the (locationstrategy and selectorvalue)
Page. Findelement("xpath", "//*[@class='mblvalu'])
If am wrong correct me
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In your code that you have written
var mblPage=VirtualBrowsers.CurrentBrowser.Navigate("https://www.smartbear.com/");
the Navigate Method returns none, and not a Page object.
and,
var page=VirtualBrowsers.Item("iPad").Run("https://www.smartbear.com/");
the Run Method returns a Process object if found, and not a Page object.
Make sure you fully understand the above methods and their return objects. In my previous response, did you see the code example in Page Object? It's vital you learn the basics, knowing how to select an object on a page, before jumping ahead and wanting to use VirtualBrowser
