can't identify the flexelement

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

can't identify the flexelement

Post by omayer » Mon Jan 14, 2013 5:51 pm

I am getting following error - Cannot implicitly convert type 'Ranorex.Core.Element' to 'bool' (CS0029) - C:\Page.cs:65,12


Code: Select all

public void ClickLink()
		{
			bool found = false;
		
			WebDocument web = "/dom[@page='a.cfm']";
	
			FlexElement mainOfficeBttn; 
			found = web.FindSingle(".//row[@index='0']/cell//element/button[@id='btnLocation' and @text='Office']",50000);
			if(found)
			{
				throw new Ranorex.ElementNotFoundException("Main office Link not Visible or clicked");
			}
			else
			{
				
			}
			mainOfficeBttn.Click();
			Validate.Exists("/dom[@caption='ageTitle']//td[@id='ageTitleHeader' and @innertext=' LOCATION ']",30000);
		
				
		}
Tipu

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: can't identify the flexelement

Post by Ciege » Mon Jan 14, 2013 7:01 pm

FindSingle returns an element not a bool.

TryFindSingle returns a bool...

Check out the Online API document. http://www.ranorex.com/Documentation/Ranorex/
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: can't identify the flexelement

Post by omayer » Mon Jan 14, 2013 8:11 pm

Thank you Ciege, tryfindsingle worked
Tipu